Grouping product list results in repeater

F

Fredrik Rodin

All,

I'm looking for a way of generating a grouping in a repeater (or other
control). Instaed of describing everything here, just look at this link and
you can see how I did it in classic asp 3.0 including source code and
SQL-script (SQL Server 2000).

http://www.rodin.se/gruppering.asp

You'll see the result with grouped products. Is there a way of doing the
same thing in ASP.NET (I'm writing everything in VB, not C#) with repeater,
datagrid or datalist???

All help is very appreciated.

Thanks in advance,
Fredrik
 
G

Guest

I have done something like that with a repeater control before. IT may not be the best way but it worked for me

in my code behind page I made this
Public Function CheckForNewGroup(byval textToCheck) as strin
'--- Do the check here and return a <Br><b>new title</b
'--- or return the next result plai
End Functio

In the ASPX page I used this in the repeater control (under ItemTemplate and Alternating Item Template) <%# CheckForNewGroup(Databinder.eval(container.dataitem, "myData") %

-Mik
 
C

Craig Deelsnyder

Fredrik said:
All,

I'm looking for a way of generating a grouping in a repeater (or other

You'll see the result with grouped products. Is there a way of doing the
same thing in ASP.NET (I'm writing everything in VB, not C#) with repeater,
datagrid or datalist???

I didn't look closely at your data, or if it is the same layout, but
it's easiest if you have mutliple tables in your datasource, one with
the list of groups, the other with the individual items.

I normally embed 'repeating controls' to accomplish this. I usually
have a datalist inside a datalist, or a repeater inside a datalist, etc.
The particular ones just depend on your layout needed.

Basically, you bind the outer control (let's say a repeater) to your
list of group names, and then you set the DataSource of the inner
control (let's say another repeater) to the list of individual items
filtered by the current group name...it's hard to explain, check out the
Reports Starter Kit, they do this in the Crosstab report, here's a
direct link to the source code of their main page:

http://asp.net/ReportsStarterKit/SourceViewer/srcview.aspx?path=crosstab.src&file=crosstab&rows=5
 
C

Craig Deelsnyder

dang, second time today my newsreader doesn't show replies, but i come
back in and someone already answered your question before my post.
sorry, hope you solved your problem....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top