public void grdpl1_DeleteCommand(object sender, DataGridCommandEventArgs e) { String DetailId = ""; DetailId = grdpl1.DataKeys[Convert.ToInt32(e.Item.ItemIndex)].ToString(); Whitfield_Project _wc = new Whitfield_Project(); _wc.DeleteWorkOrders(DetailId, ViewState["twc_project_number"].ToString()); this.DisplayGrid(); }