Solved

How to access a repeater inside a repeater.

Posted on 2010-08-26
3
413 Views
Last Modified: 2012-05-10
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
Comment
Question by:zorvek (Kevin Jones)
  • 2
3 Comments
 
LVL 81

Author Comment

by:zorvek (Kevin Jones)
ID: 33536334
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
 
LVL 16

Accepted Solution

by:
Stephan earned 500 total points
ID: 33536731
You can use the itemdatabound event for looking in each dataitem within repeaterA and then for repeaterB
0
 
LVL 16

Expert Comment

by:Stephan
ID: 33536735
RepeaterB is not availiable because it is generated by databound, that's why you can not see it through intellisense
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now