Nested Repeater - 3 levels - datasource

E

Ed Allan

I have extended the example at
http://support.microsoft.com/default.aspx?scid=kb;EN-
US;306154 to build a webform page with 3 layers of nested
Repeaters (ie. parent, child and grandchild).

I added a third DataTable to the DataSet, and created a
second Relation between the second and third DataTables.
On the aspx page I copied the child Repeater to create
the grandchild, referencing the second Relation.

It is throwing an InvalidCastException when executing the
datasource of the innermost Repeater - <%# ((DataRowView)
Container.DataItem).Row.GetChildRows
("childEvents_grandchildEvents") %> - why does it not
like the cast to DataRowView?

Many thanks in advance.
 
E

Ed Allan

I have extended the example at
http://support.microsoft.com/default.aspx?scid=kb;EN-
US;306154 to build a webform page with 3 layers of nested
Repeaters (ie. parent, child and grandchild).

I added a third DataTable to the DataSet, and created a
second Relation between the second and third DataTables.
On the aspx page I copied the child Repeater to create
the grandchild, referencing the second Relation.

It is throwing an InvalidCastException when executing the
datasource of the innermost Repeater - <%# ((DataRowView)
Container.DataItem).Row.GetChildRows
("childEvents_grandchildEvents") %> - why does it not
like the cast to DataRowView?

Many thanks in advance.
.

The offending code is not displayed in the msdn view of
this posting so here it is again <code>((DataRowView)
Container.DataItem).Row.GetChildRows
("childEvents_grandchildEvents")</code> . . . it is the
cast to DataRowView on the innermost Repeater that
fails . . . what should the datasource for the grandchild
nested repeater be? I've found several posts on various
newsgroups and forums about this problem, but no answers -
surely there's a simple answer?
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top