Results 1 to 5 of 5

Thread: Nested repeater

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2002
    Posts
    20

    Nested repeater

    I have a nested repeater, but ran in to a small problem, the repeater looks like this:

    Code:
    <asp:repeater id="Repeater1" runat="server">
    
         <ItemTemplate>
    
              <%# DataBinder.Eval(Container.DataItem, "DownName") %>       //---This one...
    
              <asp:Repeater id="Repfiles" runat="server" DataSource='<%#GetFile((string)DataBinder.Eval(Container.DataItem, "DownID"))%>'>
    
                   <ItemTemplate>
    
                        <%# DataBinder.Eval(Container.DataItem, "DownName") %>       //--- I wan't to be able to use here as well
    
                        <%# DataBinder.Eval(Container.DataItem, "SubName") %>
    
                   </ItemTemplate>
    
              </asp:Repeater> 
    
         </ItemTemplate>
    
    </asp:Repeater>

    What I'm trying to do is to use <%# DataBinder.Eval(Container.DataItem, "DownName") %> in the second nested repeater as well but it wont work, how can I use the info from the first repeater in the second?

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    I am not sure if this works, but maybe try doing this:

    Repeater1.DataBinder.Eval(Container.DataItem, "DownName")

    Worth a shot.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jul 2002
    Posts
    20
    Don't work

  4. #4
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    You would have to set the nested repeater's datasource equal to to the Container.DataItem of the parent (I'm taking a stab, since I can't run a test right now)

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jul 2002
    Posts
    20
    How do you mean?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width