public void grdpl1_UpdateCommand(object sender, DataGridCommandEventArgs e) { String DetailId = grdpl1.DataKeys[Convert.ToInt32(e.Item.ItemIndex)].ToString(); Whitfieldcore _dbClass = new Whitfieldcore(); _dbClass.UPDATEMasterMaterials(Convert.ToInt32(DetailId), ((TextBox)(e.Item.FindControl("txtReference_Number"))).Text, ((TextBox)(e.Item.FindControl("txtDescription"))).Text, "", "N", ((TextBox)(e.Item.FindControl("txtComments"))).Text); grdpl1.EditItemIndex = -1; grdpl1.ShowFooter = true; this.DisplayGrid(); }