Reputation: 2053
Below is the data which i want to use. I want to generate rad grid. If particular item is falling under same SubGroup then instead of generating labels i want to generate the dropdown list.
i.e 1st and 2nd item is having same SubGroup. So i want them to be displayed as dowpdown in rad grid.
How can i do that for all items which fall under same subgroups ?
How to provide the dataset to radgrid for this and how to handle item temple to generate dropdown and labels as per data. ?
Name Price Quantity SubGroup
1st item 10.10 1 SUB
2nd item 10.00 1 SUB
3rd item 10.00 1 SUB2
4th item 12.00 1 SUB2
5th item 20.00 1
Upvotes: 0
Views: 843
Reputation: 740
I was thinking about the solution for your problem and here is my way to solve it:
First of all we need to prepare all nessesary events for this: OnNeedDatasource, OnItemBound.
In the OnNeedDatasource event, you have to pass datasource to your radgrid. At the moment i don't have better idea than List of List as Datasource. If you do it this way, you can implement grouping mechanism for datasource, so each position of main list would have X elements, if that would be more than 1 element then you would be sure, that you have to create DropDown.
When datasource is ready, you have to implement the dropdown/label item template. The best way to do it, is to create responsible column as GridTemplateColumn, and in OnItemDataBound event of radgrid, after checking if there should be label/dropdown create dynamically the control.
This is the way i actually would do this, probably there is a better way to do it. I hope my post helped you.
Upvotes: 1