You can also indicate whether the exception was handled in the event-handling method by setting the On Row Updated Row Canceling Edit On Row Canceling Edit Row Deleted On Row Deleted Row Deleting On Row Deleting Row Editing On Row Editing Row Updating On Row Updating Grid View Class System. In my VB Gridview, I had bind several column from datatable into one single column of the gridview. The following is the VB code: Protected Sub Grid View1_Row Editing(By Val sender As Object, By Val e As Grid View Edit Event Args) 'Set the edit index. Bind Data() End Sub Protected Sub Grid View1_Row Canceling Edit(By Val sender As Object, By Val e As Grid View Cancel Edit Event Args) 'Reset the edit index. Edit Index = -1 'Bind data to the Grid View control.
Quick google search guided me to move the event to Row_Created event and every thing is okay . Thanks a tonne in Advance and any inputs will be valued and appreciated . I do notice that if I break within the Grid View1_Row Data Bound event during a refresh of the page, the values are there.
And i think binding function is passing the values back.
For example, the current data is: name: Blake, phone: 123-234-3456, email: [email protected], contact Id: 22 I type in new data: name: John, phone: 555-555-5555, email: [email protected], contact Id: 22 Data that ends up in the database: name: Blake, phone: 123-234-3456, email: [email protected], contact Id: 22 When you raise the Row Updating event your basically getting the values BEFORE the Grid View updates the row.
But I have no idea how to get those value when doing Row Editing & Row Updating. Bind Data() End Sub Protected Sub Grid View1_Row Updating(By Val sender As Object, By Val e As Grid View Update Event Args) 'Retrieve the table from the session object.
New Edit Index 'Bind data to the Grid View control. Bind Data() End Sub Private Sub Create Data Table() Dim cmd As New System.