Nested Repeaters: ItemDataBound fires in reverse order (hierarchical data)

K

KJ

I noticed the following behavior:

With 2 repeaters nested, such as:

<asp:repeater id=rptrParentRepeater runat="server">
<ItemTemplate>
<asp:Repeater id="rptrChildRepeater" runat="server"
DataSource="<%#
((DataRowView)Container.DataItem).Row.GetChildRows(RELATION_NAME)%>">
<ItemTemplate>
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:repeater>

The DataBinding code in the ASPX pages fires in normal order - that is
to say, it processes the rows in the same order as the select statement
has returned.

However, in the ItemDataBound event in the codebehind, the
ItemDataBound event for the child rows is raised before ItemDataBound
of their parent rows.

I find this odd.

Can anyone explain?

Thanks
-KJ
 

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,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top