Rowupdating in aspxgridview
i am getting old values in the rowupdation in gridview , while clicking over the update button , in my code behind i am using below code to get value. Find Control("txtunit_price") 'Reset the edit index. To get both the old and the new value of a field named unit_price, (for the example as a String. Find Control("txtdescription") Dim txtunit_price As Text Box = gvr. Edit Index = -1 'Bind data to the Grid View control. When all you've got is a Hammer, Every Problem looks like a Nail. Since you are already getting a Row Updating event, I'll work from there. Add(a Row) Next i Session("Table") = table End If Return table End Function Public Function Get Last Key() As Int32 Dim table As Data Table = Get Table() Dim max As Int32 = Int32.
I have a Grid View control and use old style manual binding with a Data Source property and invoke the Data Bind() method. Page Private Function Get Table() As Data Table ' You can store a Data Table in the session state Dim table As Data Table = Try Cast(Session("Table"), Data Table) If table Is Nothing Then table = New Data Table() Dim colid As Data Column = table. Add("ID", Get Type(Int32)) Dim nameid As Data Column = table. Read Only = True For i As Integer = 0 To 22 Dim a Row As Data Row = table. Find Control("txtqty") Dim txtdescription As Text Box = gvr. However, your problem may have more to do with the fact that you Data Bind the Grid View in Row Updating. This can be beneficial to other community members reading the thread.
There is no need to get them by using Find Control on the Grid View Row. Please remember to click “Mark as Answer” on the post that helps you. Data Bind() End Sub Protected Sub Page_Load(By Val sender As Object, By Val e As Event Args) End Sub Protected Sub grid_Row Deleting(By Val sender As Object, By Val e As Dev Express.