protected void btnProbableDelete_Click(object sender, EventArgs e) { bool result = true; bool blResult = true; string gvStagingIds = ""; rejectedRecordsBo = new RejectedRecordsBo(); foreach (GridDataItem gvRow in gvWERPTrans.MasterTableView.Items) //foreach (GridViewRow gvRow in gvWERPTrans.Rows) { CheckBox ChkBxItem = (CheckBox)gvRow.FindControl("chkId"); if (ChkBxItem.Checked) { gvStagingIds += gvWERPTrans.MasterTableView.DataKeyValues[gvRow.RowIndex]["CMFTSId"].ToString() + ","; } } result = rejectedRecordsBo.DeleteProbableDuplicatesRejectedTransaction(gvStagingIds); if (result) { // Success Message ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('Records Deleted Successfully');", true); } else { // Failure Message ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('Please Select Probable Duplicate Records');", true); } BindEquityTransactionGrid(ProcessId); }