I have a datagrid inside that datagrid one more datagrid is there.and inside that datagrid multiple records are there with one checkbox respectively.After selecting any checkbox the links which are there in front of that checkbox should be visible.
kindly check the code ASPX page code I have a datagrid
<asp:DataGrid Width="722" AutoGenerateColumns="false" CellSpacing="0" CellPadding="0" ID="dgPln" runat="server" AllowPaging="false" AllowSorting="false" ShowHeader="false" BorderWidth="0px" BorderColor="white"> <asp:BoundColumn Visible="false" DataField="pd_id"> <asp:BoundColumn Visible="false" DataField="sa_id"> <asp:TemplateColumn> <%----%> <%----%> <%-- <asp:ImageButton ID="imgbtnCrt" runat="server" ImageUrl="/images/Add to Selected.gif" border="0" CommandName="ADDCRT" /> <asp:ImageButton ID="imgBtnCmpr" runat="server" ImageUrl="/images/bt-compare.gif" border="0" CommandName="COMPR" /> <asp:ImageButton ID="imgBtnVwAll" runat="server" ImageUrl="/images/View All.gif" border="0" CommandName="VWALL" /> <%#Eval("pln_disp")%> Decision Table <%#Eval("pln_disp")%> Decision Table <asp:DataGrid AutoGenerateColumns="true" CellSpacing="0" CellPadding="5" ID="dgPlnDtls" runat="server" AllowPaging="false" AllowSorting="false" HeaderStyle-BackColor="#E4F3C7" HeaderStyle-CssClass="dg-header-is" ItemStyle-BackColor="#F5F5F5" ItemStyle-CssClass="dg-item" BorderColor="LightGray" BorderWidth="1px"> <asp:TemplateColumn HeaderText="Product Name" HeaderStyle-HorizontalAlign="Center"> <div id="dvLgo" runat="server" style="display:none"> <img id="imgInsLg" runat="server" width="85" height="30" /> <asp:Label id="lblPrdNm" runat="server" visible="false"> <asp:CheckBox ID="chkCrtLg" runat="server" visible="false" OnCheckedChanged="ChkLgLnkBtn" AutoPostBack="true" /> <asp:Label id="spnCmpLg" runat="server" visible="false" ForeColor="#95d831">Compare <asp:LinkButton ID="lnkCmpLg" runat="server" Visible="false" ForeColor="#eb6907" Font-Bold="true" OnCommand="Comp_Logo">Click to Compare <div id="dvNLgo" runat="server" style="display:none"> <asp:Label id="lblNPrdNm" runat="server" visible="false"> <asp:CheckBox ID="chkCrt" runat="server" visible="false" OnCheckedChanged="ChkLnkBtn" AutoPostBack="true" /> <asp:Label id="spnCmp" runat="server" visible="false" ForeColor="#95d831">Compare <asp:LinkButton ID="lnkCmp" runat="server" Visible="false" ForeColor="#eb6907" Font-Bold="true" OnCommand="Comp_NoLogo">Click to Compare <%--<asp:CheckBox ID="chkCrt" runat="server" />--%> <asp:TemplateColumn Visible="false"> <asp:TableCell ID="tblCell" runat="server"> <asp:TemplateColumn ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle" HeaderText="" Visible="false"> <asp:LinkButton ID="btnBuy" Text="Buy Now" runat="server" ForeColor ="#006600" Font-Bold ="true" /> <asp:BoundColumn DataField="pd_disp_nm" Visible="false" ItemStyle-HorizontalAlign='Center'> <asp:BoundColumn Visible="false" DataField="srno">
I have written following code on checkbox checked event
Public Sub ChkLnkBtn(ByVal sender As Object, ByVal e As System.EventArgs)
Dim chkCrt As CheckBox Dim dgPlnDtls As DataGrid Dim tblCell As TableCell Dim spnCmp As Label Dim lnkCmp As LinkButton chkCrt = CType(sender, CheckBox) Dim vsAttrId As String() = Split(chkCrt.Attributes("pd_prdId"), "|") If chkCrt.Checked = True Then If dgPln.Items.Count > 0 Then For Me.viCmNt = 0 To dgPln.Items.Count - 1 If vsAttrId(0) = dgPln.Items(viCmNt).Cells(0).Text & "-" & dgPln.Items(viCmNt).Cells(1).Text Then dgPlnDtls = Nothing dgPlnDtls = CType(dgPln.Items(viCmNt).Cells(2).FindControl("dgPlnDtls"), DataGrid) If dgPlnDtls.Items.Count > 0 Then For Me.viCntB = 0 To dgPlnDtls.Items.Count - 1 tblCell = Nothing tblCell = CType(dgPlnDtls.Items(viCntB).Cells(1).FindControl("tblCell"), TableCell) spnCmp = Nothing spnCmp = CType(dgPlnDtls.Items(viCntB).Cells(0).FindControl("spnCmp"), Label) lnkCmp = Nothing lnkCmp = CType(dgPlnDtls.Items(viCntB).Cells(0).FindControl("lnkCmp"), LinkButton) If vsAttrId(1) = tblCell.Text Then spnCmp.Visible = False lnkCmp.Visible = True Exit For
Exit For End If
End Sub
Please provide me solution....