As I said, I create the Grid View controls dinamically, I don't have asp tags with the Gidview control.
In fact, the first thing I tried was this protected void Page_Load(object sender, Event Args e) public void DT() protected void GView_Row Updating(object sender, Grid View Update Event Args e) protected void GView_Row Canceling Edit(object sender, Grid View Cancel Edit Event Args e) private void Bind Data() if I execute the method DT when Is Post Back then when the gridview enters in Edit Mode and I tried to Update the cells, the Row Updating never fires and after the post back the gridview keeps on edit mode without my changes, but I need to execute this method when is Post Back, in other way the gridview control fade away.
I removed everything I did with View State and edited the original post again with what I currently got. I cannot sort the Grid View because I'm trying to sort with Your code doesn't have Data Source ID.
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.
Dim dt = CType(Session("dt"), Data Table) 'Update the values.
Edit Index = -1 'Bind data to the Grid View control. Sql Command Dim sql As String Dim reader As System.
event is raised when a row's Update button is clicked, but after the Grid View control updates the row.What happens with this is that the source is being created every time the user submits the page.