I have thrice-nested ListView controls on my asp.net page, each of which is nested in a different one. I use the OnItemDataBound event in the first ListView to set the DataSource 2nd level ListView. The third ListView is contained in the second ListView. I want to assign the same DataSource to both the ListView 2nd level data source controls and the third level, but I cannot figure out how to access the 3rd level ListView to do this.
Here is an example code to help you visualize:
<asp:ListView id="level1" runat="server" OnItemDataBound="level1_ItemDataBound">
<layouttemplate>
<asp:PlaceHolder runat="server" ID="itemPlaceHolder"></asp:PlaceHolder>
</layouttemplate>
<itemtemplate>
<asp:ListView id="level2" runat="server">
<layouttemplate>
<asp:ListView id="level3" runat="server">
<layouttemplate>
<asp:PlaceHolder runat="server" ID="itemPlaceHolder"></asp:PlaceHolder>
</layouttemplate>
<itemtemplate>OUTPUT DATA FOR LEVEL 3</itemtemplate>
</asp:ListView>
</layouttemplate>
<itemtemplate>OUTPUT DATA FOR LEVEL 2</itemtemplate>
</asp:ListView>
OUTPUT DATA FOR LEVEL 1
</itemtemplate>
</asp:ListView>
level1_ItemDataBound level2, ListView, DataSource DataBind. , Level3.DataSource , Level2.DataSource. ?