Can the ItemHeader repeat for each "section break" in a Repeater?

  • Thread starter Thread starter Mike Lerch
  • Start date Start date
M

Mike Lerch

I have data like this:

Album Song
Led Zeppelin I Good Times Bad Times
Led Zeppelin I Babe I'm Gonna Leave You
Led Zeppelin I You Shook Me
Led Zeppelin I Dazed and Confused
Led Zeppelin II Whole Lotta Love
Led Zeppelin II The Lemon Song
Led Zeppelin II Heartbreaker

Is it possible for a repeater to show the Header each time the album
changes? In other words something like

Led Zeppelin I (Header)
Good Times Bad Times (Item)
Babe I'm Gonna Leave You (Item)
You Shook Me (Item)
Dazed and Confused (Item)
Led Zeppelin II (Header)
Whole Lotta Love (Item)
The Lemon Song (Item)
Heartbreaker (Item)

Any help is appreciated! PS, if the repeater won't do it, is there a
control that will?

Lerch
 
You could have :
- a repeater than handles the album and an inner repeater that handles the
titles...
- or a single repepater with a part you show/hide depending on wether or not
this is a new album.
- or a single repeater with a datasource that unions album titles and titles
- or a custom template class that output the album title when appropriate

3) is probably the simplest. Use just something like :

SELECT Album_pk,0,Title FROM Albums UNION SELECT Album_fk,Number,Title FROM
Titles ORDER BY 1,2 for your datasource...

Patrice
 
You could have :
- a repeater than handles the album and an inner repeater that handles the
titles...

Thanks for your help! That's the technique I chose to go with,
following some code at
http://support.microsoft.com/default.aspx?scid=kb;EN-US;306154

Now I just have to figure out if I can actually add and update and
delete stuff using this technique (i.e. this displays my current data
but I'd like to use something similar to, for instance, add comments
on each song or something)

Lerch
 
Back
Top