Control panel visibility inside datagrid

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi,
i have a template column in datagrid. Inside template column i have panel. I
want to control the visibility of the panel with checkbox. can this be done?

<asp:TemplateColumn>
<ItemTemplate>
<asp:Panel id="pnlDocumentDetailsGrid" runat="server"
Visible="False">
<TABLE id="Table112" cellSpacing="0" cellPadding="0"
width="100%" border="0">
<TR bgColor="#1d4076">
<TD width="1%"> </TD>
<TD align="left">
<FONT style="FONT-WEIGHT: bold; FONT-SIZE: 12pt;
FONT-FAMILY: Arial" color="#c3daff">
<%# Container.DataItem("description")%>
</FONT>
</TD>
<TD align="right">
<FONT style="FONT-WEIGHT: bold; FONT-SIZE: 12pt;
FONT-FAMILY: Arial" color="#c3daff">
Bulletin: <%# Container.DataItem("uploaddate")%>
</FONT>
</TD>
<TD>
<IMG src="../images/Curly.jpg"></TD>
</TR>
</TABLE>
</asp:Panel>
</ItemTemplate>
</asp:TemplateColumn>

Here is my codebehind itemdatabound event:


Sub dGridAvailableDocuments_Bound(ByVal sender As Object, ByVal e As
DataGridItemEventArgs)
If cBoxDocDetails.Checked Then
e.Item.FindControl("pnlDocumentDetailsGrid").Visible = True
End If

End Sub

Thanks

Manny

.



Relevant Pages

  • Datagrid Template Column
    ... I have an ASP.Net datagrid with a template column. ... controlsto the panel. ... This works great the controls are created and displayed and I can ... I have the Sub that handles the UpdateCommand. ...
    (microsoft.public.dotnet.general)
  • Re: Datagrid and datareader
    ... Sub AddImage ... Don't forget you need to add a template column to the datagrid, ... > but i can't find the section where they explain how to display images in ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Bug in VWD 2008 Express?
    ... I'm creating a page that has 4 panels with a datagrid and some links inside ... Only one panel is visible at a time selectable by links at the ... The page comes up wrong in IE, so I go back into the designer and look ... and a datagrid has been moved out of its panel and placed inside a "div" ...
    (microsoft.public.dotnet.languages.vb)
  • Re: datagrid "can grow" ?
    ... You can of course get rid of grid layout. ... You could also put the datagrid & ... all the controls below it into the same flow layout panel. ... the DIVcontaining the controls to that value + some number. ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: Advice: datagrid for news module
    ... inhere I want to make a hyperlink button. ... Under the datagrid I want to make a panel. ... the hyperlink must have an news ID... ...
    (microsoft.public.dotnet.framework.aspnet)