Simple question, not sure there\'s a simple answer!
So here\'s the code: (I\'ve simplified it a lot to make it easier to read)
Solution given by Paul didn't work for me, but this did:
<%# DataBinder.Eval(Container.Parent.Parent, "DataItem.YourProperty")%>
I have used as below. Two Repeaters act as Parent and Child.below how I get Parent value of ID Column inside Child repeater.
<%# DataBinder.Eval(((RepeaterItem)Container.Parent.Parent).DataItem, "ID") %>
I have found the answer actually:
Use:
<HeaderTemplate>
<%# ((RepeaterItem)Container.Parent.Parent).DataItem %>
</HeaderTemplate>
This is an old thread, but it seems proper to add:
In my case I have 2 nested ASPxGridView controls (DevExpress) and Container.Parent.Parent didn't work.
To access parent's data item from child, this is what worked for me:
<%# DataBinder.Eval(Container.NamingContainer.NamingContainer, "DataItem.DbField")%>
If I want to retrieve a property of a parent repeater I typically do this:
<%# DataBinder.Eval(((RepeaterItem)Container.Parent.Parent).DataItem, "ThePropertyName")%>