Repeater inside the repeater
This question is similar; although he talks about accessing a property from <HeaderTemplate>
, he feels that he should work with <ItemTemplate>
.
So try <%# ((RepeaterItem)Container.Parent.Parent).ItemIndex %>
If this does not work, you may need more .Parent
s. Try temporarily binding the ItemDataBound
handler to the internal repeater and use the fact that the RepeaterItemEventArgs
Item
property returns the same object as the Container
in aspx. So basically evaluate e.Item.Parent
, e.Item.Parent.Parent
etc., until you find one that is another RepeaterItem
. Then use the same .Parent
number in your aspx.
From MSDN: How to Display Hierarchical Data Using Nested Repeater Controls
The article is a few years old, but content is what you are looking for.