473,721 Members | 2,234 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.DataS ource = arrRepeater
Repeater1.DataB ind()
Dim arrRepeater2 As New ArrayList()
'Repeat this part for each row
x = 0
Do Until x = db_fieldproduct max
Dim htRepeater As New Hashtable()
htRepeater.Add( "ColProduct 1", db_fieldproduct (x, 1))
htRepeater.Add( "ColProduct 2", db_fieldproduct (x, 2))
arrRepeater.Add (htRepeater)
x += 1
Loop
Repeater2.DataS ource = arrRepeater2
Repeater2.DataB ind()

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.Da taItem("ColName 1")%>
Second item: <%#Container.Da taItem("ColName 2")%>
<asp:Repeater ID="Repeater2" runat="server">
<ItemTemplate >
*** Nested item 1: <%#Container.Da taItem("ColProd uct1")%>
*** Nested item 2: <%#Container.Da taItem("ColProd uct2")%>
</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.P age
Dim Repeater2 As New System.Web.UI.W ebControls.Repe ater()

-Mark
Oct 13 '05 #1
0 1765

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

Similar topics

3
2709
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 it's useless. Anytime i try to reference rptChild I get an error saying that it's not an object. If I set a break point I see that it's <nothing>. Here is a sample of code that shows the problem. I would REALLY appreciate any help on getting...
1
3160
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 databinder.eval(Container.DataItem, "Net", "{0:c}") . BUT I use that code in the nested repeater and IT DOES NOT WORK!!!! In that code I have DataBinder.Eval (Container.DataItem, "Reduction", "{0:c}") and the page gives me the error "Error:...
0
5401
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 get the code in a text file. > >Thanks - Ed >
2
3300
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 reference not set to an instance of an object". This error message commonly occurs when a server control is incorrecly declared, so naturally I have double checked this. To test this, I moved the aspx code for the DataGrid ('myNestedDataGrid')...
2
2131
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 function. My objects aren't null, my ItemDataBound() method is being called, and as you can see I have verified that I have data. Yet, the repeater does not appear in the final HTML, and what's more, after
2
1907
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 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,...
0
324
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 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...
1
7131
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 following the www.asp.net data access tutorials to create a DAL and BLL to connect my web site (a simple real estate property search web site) to my database (Sql Express 2005).
2
2604
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 each nested repeater is shown below (it's in the gridview's RowDataBound event). My question is this: what can I do to speed up this process? Currently EVERY time a new gridview row is generated the code reaches out to the database, grabs the...
0
8730
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9215
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9064
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5981
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4484
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4753
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3189
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2130
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.