By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,183 Members | 1,212 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,183 IT Pros & Developers. It's quick & easy.

nested repeaters

P: n/a
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

Nov 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.