Dynamic Column that contains a Repeater

Posted by djbyter on Stack Overflow See other posts from Stack Overflow or by djbyter
Published on 2010-02-18T20:38:02Z Indexed on 2010/03/18 14:01 UTC
Read the original article Hit count: 402

Filed under:
|
|
|

How would I go about doing this programatically?

I can do this just fine declaratively, using a template column and then using something like this:

    ...
<TemplateGridColumn>
    <ItemTemplate>
       <div>
          <asp:Image ID="groupImg" CssClass="groupImg" runat="server"/>
          <asp:Repeater ID="groupItemRpt" runat="server">
             <HeaderTemplate>
                <ul class="groupItemList">
             </HeaderTemplate>
             <ItemTemplate>
                <li>
                   <asp:Image ID="itemImg" runat="server" />
                   <asp:HiddenField ID="itemValue" runat="server" />
                </li>
             </ItemTemplate>
             <FooterTemplate>
                </ul>
             </FooterTemplate>
          </asp:Repeater>
       </div>
    </ItemTemplate>
    </TemplateGridColumn>
...

I am dynamically creating this grid based on the data, so I'm already added columns with one set of controls. But now I need to figure out how to show multiple images, which expand/contract if the groupImg image control is clicked (i just toggle the ul) ..

Can anyone point me in the right direction? Thanks.

© Stack Overflow or respective owner

Related posts about .NET

Related posts about ASP.NET