Grouping
RadListView supports both custom grouping and automatic grouping based on a certain property.
Basic Grouping
The basic grouping is achievable by enabling the EnableGrouping and ShowGroups properties and then adding the desired GroupDescriptors to the GroupDescriptors collection of the control. The following code will group the items according to their Value property:
Group by value
Before Grouping | After Grouping |
---|---|
![]() |
![]() |
And here is how you can group by a certain column when DetailsView is used:
Group by column "Type"
Before Grouping | After Grouping |
---|---|
![]() |
![]() |
Custom Grouping
To take advantage of the custom grouping feature of RadListView, just enable the EnableCustomGrouping property and specify the Group for each item. Here is an example for custom grouping:
Custom Grouping
Items in a certain group are sorted in the order of setting the Group property of each ListViewDataItem.
Please note, that if you are using data binding, you can use the ItemDataBound event, to assign certain item to a certain group.
Before grouping | After grouping |
---|---|
![]() |
![]() |
When grouping is enabled you have the option to quickly expand or collapse all groups in RadListView throught the ExpandAll and CollapseAll methods: