From rowupdating

Edit Index = -1; bind(); } public void bind Gv Edit() { Grid View1. Edit Index = -1; bind Gv Edit(); } protected void Grid View1_Row Updating(object sender, Grid View Update Event Args e) { Grid View Row row = Grid View1.

Data Bind(); } protected void Grid View1_Row Editing(object sender, Grid View Edit Event Args e) { Grid View1. New Edit Index; bind Gv Edit(); } protected void Grid View1_Row Canceling Edit(object sender, Grid View Cancel Edit Event Args e) { Grid View1.

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.

from rowupdating-69from rowupdating-55from rowupdating-44

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.

Edit Index = -1 'Bind data to the Grid View control. Sql Command Dim sql As String Dim reader As System.

If we move our mouse on to the variables, which hold the cell values, we can see the old value instead of new updated value (Refer the debugging Screen Shot at the Top).

protected void Task Grid View_Row Updating(object sender, Grid View Update Event Args e) { //Retrieve the table from the session object.

Data Table dt = (Data Table)Session["Task Table"]; //Update the values. Data Item Index]["Is Complete"] = ((Check Box)(row. Bind Data(); } You're accessing so many items without null checks that it could be any number of things. Are you sure all of the controls exist in the cells you're specifying? protected void Grid View1_Row Updating(object sender, Grid View Update Event Args e) { Grid View Row row = (Grid View Row)Grid View1. Edit Index = -1; //Bind data to the Grid View control. Find Control("que"); My Sql Command cmd = new My Sql Command("update exam set [email protected],[email protected] where id = @id", con); cmd. Find Control("nam"); Text Box tques = (Text Box)row.