nested repeaters

G

Guest

Is it possible to have nested repeaters three layers deep

I have gotten it to work with only two, and when I tried to get the third layer to work


COD
<asp:repeater id="rep" runat="server"><ItemTemplate><span style="BACKGROUND-COLOR: silver"><%# DataBinder.Eval(Container.DataItem, "CustomerID") %>&nbsp
<%# DataBinder.Eval(Container.DataItem, "CompanyName") %></span><br /><asp:repeater id="childRepeater" runat="server" datasource='<%# ((DataRowView)Container.DataItem
.Row.GetChildRows("relation") %>' ><itemtemplate>&nbsp;&nbsp;&nbsp;<%# DataBinder.Eval(Container.DataItem, "[\"OrderID\"]") %>&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;<%# DataBinder.Eval(Container.DataItem, "[\"OrderDate\"]") %><br /><asp:repeater id="Repeater1" runat="server" datasource='<%# ((DataRowView)Container.DataItem
.Row.GetChildRows("orderrel") %>' ><itemtemplate>&nbsp;&nbsp;&nbsp;<%# DataBinder.Eval(Container.DataItem, "[\"ProductID\"]") %>&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;<%# DataBinder.Eval(Container.DataItem, "[\"UnitPrice\"]") %><br /></itemtemplate></asp:repeater></itemtemplate></asp:repeater></ItemTemplate></asp:repeater

/COD

I got this error on the datasource line
Specified cast not vali


COD

<asp:repeater id="Repeater1" runat="server" datasource='<%# ((DataRowView)Container.DataItem).Row.GetChildRows("orderrel") %>'

/COD

By the way, all of this is built against the Northwind database for testing purposes. I can post my codebehind for all of the relations if you want. However, I checked it by commenting out the top layer of relations and only using the bottom two repeaters with orders and order details, and it works fine

-Thanks
 

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

Members online

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,783
Latest member
RickeyDort

Latest Threads

Top