Another Repeater question

Discussion in 'ASP .Net Web Controls' started by Peter Kirk, Oct 6, 2005.

  1. Peter Kirk

    Peter Kirk Guest

    Hi

    I generate an array of Port objects, and "bind" them to a repeater, called
    PortList, like this:

    PortList.DataSource = ports;
    PortList.DataBind();

    I can then use this in my asp, like this (pseudo asp):

    <asp:repeater id="PortList" Runat="server">
    <ItemTemplate>
    <%# ((IPort)Container.DataItem).Name %><br>
    <%# ((IPort)Container.DataItem).ArrivalDate %><br>
    </ItemTemplate>
    </asp:repeater>

    But, one of the properties of my Port object is itself an array - of
    "comments" (strings). How do I get my PortList repeater to also display the
    array of comments for each Port?

    Something like:

    <asp:repeater id="PortList" Runat="server">
    <ItemTemplate>
    <%# ((IPort)Container.DataItem).Name %><br>
    <%# ((IPort)Container.DataItem).ArrivalDate %><br>

    <!-- Comments is an array of strings, each of which need to be
    displayed. -->
    <%# ((IPort)Container.DataItem).Comments %><br>

    </ItemTemplate>
    </asp:repeater>


    Thanks for any help,
    Peter
     
    Peter Kirk, Oct 6, 2005
    #1
    1. Advertising

  2. Peter Kirk

    Peter Kirk Guest

    "Peter Kirk" <> skrev i en meddelelse
    news:...
    > Hi


    > But, one of the properties of my Port object is itself an array - of
    > "comments" (strings). How do I get my PortList repeater to also display
    > the array of comments for each Port?
    >


    Hi again - I found out I can define another "nested" repeater directly on my
    asp. (One reason I wasn't seeing anything when I tried this before was that
    there wa sno data in my database!)

    Peter
     
    Peter Kirk, Oct 6, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    889
  2. Replies:
    0
    Views:
    2,916
  3. Replies:
    1
    Views:
    7,058
    Karl Seguin
    Aug 10, 2005
  4. uncensored
    Replies:
    0
    Views:
    836
    uncensored
    Oct 25, 2006
  5. Microsoft

    Repeater inside a Repeater

    Microsoft, Aug 21, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    220
    Microsoft
    Aug 21, 2006
Loading...

Share This Page