Fredrik Rodin wrote:
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/Sou...rosstab&rows=5
--
Craig Deelsnyder
Microsoft MVP - ASP.NET