Vb net rowupdating event
After searching long and hard I found a great article that solved my issue.Take a look at the page load if you are binding on post back then the values get updated before you are able to access them. To String() Dim str Last Name As String = Direct Cast(Grid View1. Text Dim command As Sql Command = New Sql Command("updatetest", cn) command. I am using a SQLData Source to populate my gridview in ASP. When I hit Edit, the textboxes appear and I am able to edit my values. I am using a SQLData Source to populate my gridview in ASP. When I hit Edit, the textboxes appear and I am able to edit my values. In the Row Editing function, the edit textboxes appear and I can get the "old" values Then the page renders, I edit the textboxes and hit Update.
New Values("Control_Seq Ref_CH") Dim rowindex As Integer = e. New Edit Index 'Bind data to the Grid View control. Bind Data() End Sub Private Sub Create Data Table() Dim cmd As New System. Dim dt = CType(Session("dt"), Data Table) 'Update the values. Yes, I did put the breakpoint at the Row Updating line (and not in the function).
You have to make sure that you aren't setting your Grid View's data when it is not postback.
If you do this, your Grid View's source will be refreshed before you're able to grab the new values out of it.