Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Because I have customerize my DetailsView control by "edit template", I need to convert the field (it is seven checkboxlists) to a string value. So I write up some a function to handle ItemUpdating event:

        Sub DetailsViewUpdateing(ByVal sender As Object, ByVal Args As DetailsViewUpdateEventArgs) Handles DetailsView1.ItemUpdating
           Dim abc As DetailsView
           abc = sender
           HiddenScheduleStringA.Value = Convert24ChkBoxToString(abc.FindControl("ChkBoxListSchedule1"), abc.FindControl("ChkBoxListSchedule2"), abc.FindControl("ChkBoxListSchedule3"), abc.FindControl("ChkBoxListSchedule4"), abc.FindControl("ChkBoxListSchedule5"), abc.FindControl("ChkBoxListSchedule6"), abc.FindControl("ChkBoxListSchedule7"))
           Dim sName, sSchedule, sID, sNote As New Parameter
           sID.Name = "sID"
           sName.Name = "sName"
           sSchedule.Name = "sSchedule"
           sNote.Name = "sNote"
           sID.DefaultValue = Args.Keys("sID")
           sName.DefaultValue = CStr(Args.NewValues("sName"))
           sNote.DefaultValue = CStr(Args.NewValues("sNote"))
           sSchedule.DefaultValue = HiddenScheduleStringA.Value
           sourceShift.UpdateParameters("sSchedule") = sSchedule
           sourceShift.UpdateParameters("sName") = sName
           sourceShift.UpdateParameters("sID") = sID
           sourceShift.UpdateParameters("sNote") = sNote
           sourceShift.Update()
       End Sub

I traced the flow with Debug tool. I found the Database do updated at the END of this function! However, it turn back to old value at the DetailsView databinding event.....

What should I do? What am I missed? Please give me some idea. Thanks!

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...