public void grdEstimateMaterials_UpdateCommand(object sender, DataGridCommandEventArgs e) { String DetailId = grdEstimateMaterials.DataKeys[Convert.ToInt32(e.Item.ItemIndex)].ToString(); contingency _wc = new contingency(); _wc.UpdateTerms(Convert.ToInt32(DetailId), ((TextBox)(e.Item.FindControl("txtdesc"))).Text); grdEstimateMaterials.EditItemIndex = -1; grdEstimateMaterials.ShowFooter = true; DataSet dsGridResults = _wc.FetchQualData(); PopulateDataGrid(dsGridResults, grdEstimateMaterials); }