/// <summary> /// Removes a case from the list /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnRemove_Click(object sender, EventArgs e) { // find out which row we are deleting ImageButton btnRemove = (ImageButton)sender; GridViewRow gvRow = (GridViewRow)btnRemove.Parent.Parent; // find the job ID int lastCol = gvRow.Cells.Count - 1; string recordID = gvRow.Cells[lastCol].Text.Replace("<nobr>", ""); recordID = recordID.Replace("</nobr>", ""); // get the case status from the session caseStatus = Session["caseStatus"] != null ? Session["caseStatus"].ToString() : "N"; // set the status to deleted bi.UpdateCaseByRecordID(recordID, "D"); // retrieve the cases and display them on the page DataTable dt = bi.GetSubmittedJobsInfo(caseStatus); this.gvJobStatus.ShowHeader = true; this.gvJobStatus.DataSource = null; this.gvJobStatus.DataSource = dt; this.gvJobStatus.DataBind(); }