Get boundfield value in rowupdating

Dim dt = CType(Session("dt"), Data Table) 'Update the values. 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. using the grid view row find control method you can get the control and its values. I'm using a gridview and edit mode to make it easy for the user to change values. If that doesn't happen, getting it from the Text Box is a good way. When all you've got is a Hammer, Every Problem looks like a Nail.

Good attempt, but the correct way is to not suck back values out of the gridview after it is bound.

I had bind several column from datatable into one single column of the gridview. The following is the aspx code: Private Sub Create Data Table() Dim cmd As New System.

But I have no idea how to get those value when doing Row Editing & Row Updating.

A Grid View Update Event Args object is passed to the event-handling method, which enables you to determine the index of the current row and to indicate that the update operation should be canceled.

To cancel the update operation, set the collections, if necessary, before the values are passed to the data source.

Leave a Reply