public void grdpl1_UpdateCommand(object sender, DataGridCommandEventArgs e) { String DetailId = grdpl1.DataKeys[Convert.ToInt32(e.Item.ItemIndex)].ToString(); Whitfieldcore _dbClass = new Whitfieldcore(); _dbClass.UPDATESubMaterials(Convert.ToInt32(DetailId), ((TextBox)(e.Item.FindControl("txtthickness"))).Text, ((TextBox)(e.Item.FindControl("txtlength"))).Text, ((TextBox)(e.Item.FindControl("txtweight"))).Text, ((TextBox)(e.Item.FindControl("txtwidth"))).Text, ((TextBox)(e.Item.FindControl("txtDescription"))).Text, ((TextBox)(e.Item.FindControl("txtCost"))).Text, Convert.ToInt32(((DropDownList)(e.Item.FindControl("ddlUOM"))).SelectedItem.Value), ((RadioButtonList)(e.Item.FindControl("chkLEED"))).SelectedItem.Value, ((TextBox)(e.Item.FindControl("txtManufacturer"))).Text, ((RadioButtonList)(e.Item.FindControl("chkFSC"))).SelectedItem.Value, ((TextBox)(e.Item.FindControl("txtMaterial_Code"))).Text, ((TextBox)(e.Item.FindControl("txtNotes"))).Text, ((RadioButtonList)(e.Item.FindControl("chkDefault_Field"))).SelectedItem.Value); grdpl1.EditItemIndex = -1; grdpl1.ShowFooter = true; this.DisplayGrid(Convert.ToInt32(ViewState["material_id"].ToString())); }