AIBMass
asked on
Hiding a control in a TemplateField in a GridView
I have the following Template field in a GridView:
<asp:TemplateField HeaderText="PIP">
<ItemTemplate>
<asp:Label runat="server" Text='<%#Eval("PIP") %>'></asp:Label>
<asp:CheckBox ID="chkPIP" runat="server" />
</ItemTemplate>
</asp:TemplateField>
On some rows, I do not want the CheckBox to be visible or at least not checkable.
I am trying to use the RowDataBound event, but I can't figure out how to reference my checkbox control.
Can anyone show me how?
<asp:TemplateField HeaderText="PIP">
<ItemTemplate>
<asp:Label runat="server" Text='<%#Eval("PIP") %>'></asp:Label>
<asp:CheckBox ID="chkPIP" runat="server" />
</ItemTemplate>
</asp:TemplateField>
On some rows, I do not want the CheckBox to be visible or at least not checkable.
I am trying to use the RowDataBound event, but I can't figure out how to reference my checkbox control.
Can anyone show me how?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Completely perfect. Thanks.
I think the link I followed was this.
Building a referencable dynamic gridview