GridViewRow row = GridView1.Rows[e.RowIndex]; if (Session["dt"] != null) { DataSet dt1 = (DataSet)Session["dt"]; dt1.Tables[0].Rows[row.DataItemIndex][0] = ((TextBox)(row.Cells[1].Controls[0])).Text; dt1.Tables[0].Rows[row.DataItemIndex][1] = ((TextBox)(row.Cells[2].Controls[0])).Text; dt1.Tables[0].Rows[row.DataItemIndex][2] = ((TextBox)(row.Cells[3].Controls[0])).Text; dt1.Tables[0].Rows[row.DataItemIndex][3] = ((TextBox)(row.Cells[4].Controls[0])).Text; GridView1.EditIndex = -1; binddata(); } if (Session["key"] != null) { Response.Write("hello"); DataSet dt2 = (DataSet)Session["key"]; // GridViewRow row1 = GridView1.Rows[e.RowIndex]; dt2.Tables[0].Rows[row.DataItemIndex][0] = ((TextBox)(row.Cells[1].Controls[0])).Text; dt2.Tables[0].Rows[row.DataItemIndex][1] = ((TextBox)(row.Cells[2].Controls[0])).Text; dt2.Tables[0].Rows[row.DataItemIndex][2] = ((TextBox)(row.Cells[3].Controls[0])).Text; dt2.Tables[0].Rows[row.DataItemIndex][3] = ((TextBox)(row.Cells[4].Controls[0])).Text; GridView1.EditIndex = -1; binddata(); }
e.RowIndex
GridView.Rows
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)