sorting an a-z list (asp:repeater)

G

Guest

Hi

I want to use an Asp:Repeater to create a list of items. I want the list to
be 3 columns wide, and order like so...

AA AD AG
AB AE AH
AC AF AI

I'm not sure how to get this to work. The only way I can think of is to get
a complete list, get the total records, divide by 3 and setup 3 repeaters,
and load the first with 1 to (total / 3), the second with (total / 3) to
((total / 3) + (total / 3)) and the third with ((total / 3) + (total / 3)) to
total.

Seems long winded though - any suggestions?!

Cheers


Dan
 
M

Marina

The repeater can't do this, because it is meant to just repeat your template
over and over. It doesn't add any of its own HTML on top of that (which is
what you would need to create the table).

For the behavior you are looking for, use a DataList. This has a
RepeatColumns and a RepeatDirection property, and the combination of these
can let you accomplish what you want.
 

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,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top