• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 425
  • Last Modified:

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
0
zorvek (Kevin Jones)
Asked:
zorvek (Kevin Jones)
  • 2
1 Solution
 
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:
You can use the itemdatabound event for looking in each dataitem within repeaterA and then for repeaterB
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

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now