public void grdAmendments_DeleteCommand(object sender, DataGridCommandEventArgs e) { String DetailId = ""; DetailId = grdAmendments.DataKeys[Convert.ToInt32(e.Item.ItemIndex)].ToString(); contingency _wc = new contingency(); _wc.DeleteAmendmentList(Convert.ToInt32(DetailId)); BindAmendmentList(Convert.ToInt32(ViewState["EstNum"].ToString())); }