private void BindSubGrid(RepeaterItem itm) { var grd = itm.FindControl("gvOrder") as GridView; var trSubTable = itm.FindControl("trSubTable") as HtmlTableRow; int OrderID = Convert.ToInt32((itm.FindControl("lblorderid") as Label).Text); ((ImageButton)itm.FindControl("ibtnNOExpColap")).ImageUrl = "~/images/collapse.JPG"; DataTable dtBOPlist = BranchOrderObj.BindBranchOrderProductList(OrderID); string strLS = ((HiddenField)itm.FindControl("hfLSpdf")).Value.ToString(); string str = ((HiddenField)itm.FindControl("hfOrderPdf")).Value.ToString(); if (dtBOPlist.Rows.Count > 0) { if (!string.IsNullOrEmpty(strLS)) { (itm.FindControl("hlLSpdf") as HyperLink).Visible = true; //(itm.FindControl("lbtnLSpdf") as LinkButton).Visible = true; } else { (itm.FindControl("hlLSpdf") as HyperLink).ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3"); } if (!string.IsNullOrEmpty(str)) { (itm.FindControl("hlPDF") as HyperLink).Visible = true; //(itm.FindControl("lbtnOrderpdfDownload") as LinkButton).Visible = true; } else { (itm.FindControl("hlPDF") as HyperLink).ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3"); } grd.DataSource = dtBOPlist; grd.DataBind(); trSubTable.Style.Add(HtmlTextWriterStyle.Display, "''"); } else { trSubTable.Style.Add(HtmlTextWriterStyle.Display, "none"); } }