protected void CaptCashGV_RowDataBound(object sender, GridViewRowEventArgs e) { DataSet RptDs = BLL_PB_PortageBill.LatestReportID(); for (int i = 0; i < CaptCashGV.Rows.Count; i++) { string Id = ((Label)(CaptCashGV.Rows[i].Cells[CaptCashGV.Columns.Count - 2].FindControl("lblrptID"))).Text; string Vessel = ((Label)(CaptCashGV.Rows[i].Cells[CaptCashGV.Columns.Count - 1].FindControl("lblVesselCode"))).Text; for (int j = 0; j < RptDs.Tables[0].Rows.Count; j++) { if ((RptDs.Tables[0].Rows[j][0].ToString() == Id) && (RptDs.Tables[0].Rows[j][1].ToString() == Vessel)) { ImageButton imgbtn = (ImageButton)(CaptCashGV.Rows[i].Cells[CaptCashGV.Columns.Count - 3].FindControl("btnUnlcok")); imgbtn.Enabled = true; } else { //ImageButton imgbtn = (ImageButton)(CaptCashGV.Rows[i].Cells[CaptCashGV.Columns.Count - 3].FindControl("btnUnlcok")); //imgbtn.ImageUrl = "~/images/lock.png"; } } } if (e.Row.RowType == DataControlRowType.DataRow) { //ImageButton imgbtn = (ImageButton)(e.Row.Cells[CaptCashGV.Columns.Count - 3].FindControl("btnUnlcok")); //string Id = ((Label)(e.Row.Cells[CaptCashGV.Columns.Count - 2].FindControl("lblrptID"))).Text; //string Vessel = ((Label)(e.Row.Cells[CaptCashGV.Columns.Count - 1].FindControl("lblVesselCode"))).Text; //NameValueCollection queryStringsView = new NameValueCollection(); //Session["Name"] = e.Row.Cells[0].Text.ToString(); //queryStringsView.Add("ViewId", Id); //queryStringsView.Add("ViewId", Vessel); //string encryptedStringview = CryptoQueryStringHandler.EncryptQueryStrings(queryStringsView, // WebConfigurationManager.AppSettings["CryptoKey"]); //string popupScriptview = "ViewPopupId('" + queryStringsView + "')"; //for (int k = 0; k < e.Row.Cells.Count - 1; k++) //{ // if (k != CaptCashGV.Columns.Count - 3) // { // e.Row.Attributes.Add("onMouseOver", "this.style.cursor='hand';"); // e.Row.Attributes.Add("onclick", popupScriptview); // } //} } }