Another Repeater question

P

Peter Kirk

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
 
P

Peter Kirk

Peter Kirk said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top