Nested Repeater - 3 levels - datasource

  • Thread starter Thread starter Ed Allan
  • Start date Start date
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.
 
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?
 
Back
Top