How to access a repeater inside a repeater.

I have a repeater inside a repeater:

<asp:Repeater id="RepeaterA" runat="server">
  <ItemTemplate>
    <p>
      <%# DataBinder.Eval(Container.DataItem, "Field1") %>
    </p>
    <asp:Repeater ID="RepeaterB" datasource='<%# ((DataRowView)Container.DataItem).Row.GetChildRows("Relation") %>' runat="server">
      <ItemTemplate>
        <asp:CheckBox ID="CheckBox" runat="server" Text="" />
      </ItemTemplate>
    </asp:Repeater>
  </ItemTemplate>
</asp:Repeater>

How can I access the control CheckBox? I only see RepeaterA from my C# code.

Kevin
LVL 81
zorvek (Kevin Jones)ConsultantAsked:
Who is Participating?
 
StephanConnect With a Mentor Lead Software EngineerCommented:
You can use the itemdatabound event for looking in each dataitem within repeaterA and then for repeaterB
0
 
zorvek (Kevin Jones)ConsultantAuthor Commented:
Also, I need to get the total count of CheckBox controls...or at least figure out how to index through the complete list.

Kevin
0
 
StephanLead Software EngineerCommented:
RepeaterB is not availiable because it is generated by databound, that's why you can not see it through intellisense
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.