Repeater Control and Key Breaks

P

Peter Johansen

I have a question regarding the most effective way to implement key breaks
in a repeater control. Consider the following data in a SQL table :

Cat. | Products
-----------------
Fruits | Oranges
Fruits | Apples
Sweets | Marshmallows
Sweets | Gummies

What I would like to do is display them as follows :

Fruits :
Oranges
Apples
Sweets :
Marshmallows
Gummies

In ASP this would have been fairly simple. I would have used a key
comparison field to check if the category of the current record matches the
category of the previous record. If it doesn't I would just display the
category before displaying the product.

Although I suppose I can still do that in ASP.NET, I would like to do it
using an ASP.NET control. I have successfully been able to display the
products using the repeater control by basically just binding the dataset
from the SQL query to the repeater control, but I'm not sure how to
manipulate the output of the repeater control so it matches the format
descibed above.

Any ideas?
 

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,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top