473,396 Members | 1,917 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Nested Repeater - unable to get data

My problem is I need to have a "nested" repeater. I have an array which I
load into a hashtable - that part works great. I can setup the second
repeater to work just fine, as long as it's not nested within the first
repeater. If it is nested within the first repeater, I don't get any data.
If I put the second repeater as a separate repeater, not nested, it works
fine.

Here's my actual code, showing data pulled from the array within a loop:

Dim arrRepeater As New ArrayList()
'Repeat this part for each row
x = 0
Do Until x = db_fieldnamemax
Dim htRepeater As New Hashtable()
htRepeater.Add("ColName1", db_fieldname(x, 1))
htRepeater.Add("ColName2", db_fieldname(x, 2))
arrRepeater.Add(htRepeater)
x += 1
Loop
Repeater1.DataSource = arrRepeater
Repeater1.DataBind()
Dim arrRepeater2 As New ArrayList()
'Repeat this part for each row
x = 0
Do Until x = db_fieldproductmax
Dim htRepeater As New Hashtable()
htRepeater.Add("ColProduct1", db_fieldproduct(x, 1))
htRepeater.Add("ColProduct2", db_fieldproduct(x, 2))
arrRepeater.Add(htRepeater)
x += 1
Loop
Repeater2.DataSource = arrRepeater2
Repeater2.DataBind()

Would someone please point me in the right direction on how to use a
nested repeater??

Here is my frontside code (where I think the problem is):

<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
First item: <%#Container.DataItem("ColName1")%>
Second item: <%#Container.DataItem("ColName2")%>
<asp:Repeater ID="Repeater2" runat="server">
<ItemTemplate>
*** Nested item 1: <%#Container.DataItem("ColProduct1")%>
*** Nested item 2: <%#Container.DataItem("ColProduct2")%>
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:Repeater>
Also, the "Repeater2" shows undefined (in the code behind), unless we add
the following
statement in the code behind:

Partial Class MainPage
Inherits System.Web.UI.Page
Dim Repeater2 As New System.Web.UI.WebControls.Repeater()

-Mark
Oct 13 '05 #1
0 1734

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Tommy | last post by:
I have been working on getting nested repeaters to work for several days. When I add a repeater inside my item template i cannot see it in my code and can't set the datasource for it, etc, thus...
1
by: Bojesphob | last post by:
Can someone help? I have a nested repeater in which I wish to format one of the bits of data in currency. I know that the code for the regular repeater (which works fine in parent) is...
0
by: Ed Allan | last post by:
http://ejaconsulting.com/nestedrepeater/NestedRepeater.txt >-----Original Message----- >Doh! The HTML has all been rendered . . . > >Right click on this link and select 'Save target as ..' >to...
2
by: Stephen Miller | last post by:
I am using the OnItemDataBound event of Repeater control to nest a DataGrid within the Repeater. When I attempt to bind to the DataGrid using the DataSource method I get the error message "Object...
2
by: Colin Nicholls | last post by:
Platform: ASP.NET 1.1 I have a repeater nested inside another repeater. My outer repeater is looping fine. I am manually binding the inner repeater to a DataReader obtained from another...
2
by: mark | last post by:
(not sure if this is the correct group) My problem is I need to have a "nested" repeater. I have an array which I load into a hashtable - that part works great. I can setup the second repeater...
0
by: mark | last post by:
My problem is I need to have a "nested" repeater. I have an array which I load into a hashtable - that part works great. I can setup the second repeater to work just fine, as long as it's not...
1
by: jazzart | last post by:
Hi there, I'm fairly new to programming with Asp.Net 2.0 so I'm finding myself regularly fumbling around in the dark a bit, so to speak. I'm currently using Visual Web Developer and have been...
2
by: ASF | last post by:
Hey all, I have a gridview which pulls from a BLL which pulls from a DAL (an .XSD file). Each row on that gridview has a nested repeater which pulls from another table. The code which populates...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.