473,386 Members | 1,819 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,386 software developers and data experts.

nested asp.net repeater with objectdatasource

I need to generated a list from data from 2 database tables.
1st list CATEGORY consists of columns
CATID|CATEGORYNAME|

2nd table ITEM has columns
ID|CATEGORYID|NAME|

<asp:repeater id=parent datasourceid=ds1 runat=server>
<itemtemplate>
<h1><%# Eval("CATEGORYNAME")%></h1><ul>
<asp:repeater id=childdatasourceid=ds2 runat=server>
<itemtemplate>
<li><%# Eval("ID")%>. <%# Eval("NAME")%></li>
</itemteplate>
</asp:repeater></ul>
</itemteplate>
</asp:repeater>

The problem with this is the child repeater doesn't know which instance of
the parent repeater it belongs to.
The output looks like this

Category 1
Item 1 of category 1
Item 2 of category 1
Category 2
Item 1 of category 1
Item 2 of category 1
Category 3
Item 1 of category 1
Item 2 of category 1
....

How do you set up a relationship between the two objectdatasources (CATEGORY
and ITEM)?

The correct html output shoud look like this

Category 1
Item 1 of category 1
Item 2 of category 1
Category 2
Item 1 of category 2
Item 2 of category 2
Category 3
Item 1 of category 3
Item 2 of category 3
....

Thanks,
Howard
Jun 11 '06 #1
0 1175

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

Similar topics

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...
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: Howard | last post by:
I need to generated a list from data from 2 database tables. 1st list CATEGORY consists of columns CATID|CATEGORYNAME| 2nd table ITEM has columns ID|CATEGORYID|NAME| <asp:repeater id=parent...
1
by: mwhitlatch | last post by:
I have a repeater where the data is filtered by a param in the querystring. In the repeater I have a dropdown that needs to only show the data based upon the filter I set up in the datasource. I have...
0
by: =?Utf-8?B?cGI2NDgxNzQ=?= | last post by:
We have been having this problem for months and always assumed it was because of our somewhat complicated setup. I have just spent almost all of today making this into a simple example that can be...
4
by: =?Utf-8?B?SmFtZXMgR2V1cnRz?= | last post by:
On my page, I have one repeater that contains a literal control and a nested repeater. The nested repeater contains a literal control. Both repeaters are databound with only one object (string). ...
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...
1
by: HockeyFan | last post by:
protected void gvAuthorizedSigners_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EmptyInsert") { odsAuthorizedSigners.Insert(); return; } if (e.CommandName...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.