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?
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?