protected void UpdateEdit(object sender, System.Web.UI.WebControls.GridViewUpdateEventArgs e) { GridViewRow row = grid.Rows[e.RowIndex]; System.Diagnostics.Debug.WriteLine(dt1.Rows[row.DataItemIndex]["OrderID"].ToString()); dt1.Rows[row.DataItemIndex]["OrderTrackingNumber"] = ((TextBox)(row.Cells[0].Controls[0])).Text; dt1.Rows[row.DataItemIndex]["OrderDate"] = ((TextBox)(row.Cells[1].Controls[0])).Text; dt1.Rows[row.DataItemIndex]["OrderCustomerNumber"] = ((TextBox)(row.Cells[2].Controls[0])).Text; dt1.Rows[row.DataItemIndex]["CustName"] = ((TextBox)(row.Cells[3].Controls[0])).Text; dt1.Rows[row.DataItemIndex]["CustOfficeAddress1"] = ((TextBox)(row.Cells[4].Controls[0])).Text; dt1.Rows[row.DataItemIndex]["OrderRouteNumber"] = ((TextBox)(row.Cells[5].Controls[0])).Text; grid.EditIndex = -1; BLL.UpdateOrder( ((TextBox)(row.Cells[0].Controls[0])).Text, ((TextBox)(row.Cells[1].Controls[0])).Text, ((TextBox)(row.Cells[2].Controls[0])).Text, ((TextBox)(row.Cells[3].Controls[0])).Text, ((TextBox)(row.Cells[4].Controls[0])).Text, ((TextBox)(row.Cells[5].Controls[0])).Text, dt1.Rows[row.DataItemIndex]["OrderID"].ToString() ); grid.DataSource = dt1; grid.DataBind(); }