The
RadListView
control is now obsolete and will be removed in the future. Use the RadCollectionView control instead. TheRadCollectionView
is a complete, ground-up rewrite of the ListView. TheRadCollectionView
offers improved performance, enhanced features, and a modernized approach to managing lists of data. TheRadCollectionView
incorporates all of the ListView's key features. More about the differences between both components and how to migrate to the newRadCollectionView
is available in the Migrating the Telerik .NET MAUI RadListView to RadCollectionView article.
.NET MAUI ListView Multi-Level Grouping
This article provides an overview on how you can enable multi-level grouping in the ListView.
Before proceeding, go through the Grouping Overview topic.
1. Create the following business object:
2. Create a ViewModel
class as shown below:
3. To visualize the hierarchical relation between groups, add a custom GroupHeaderTemplate
(of type DataTemplate
) to the Resources of your page:
4. The LevelToMarginConverter
calculates the margin of each group header according to its Level:
5. Add the RadListView
definition with two PropertyGroupDescriptors
as shown in the next snippet:
6. Include the telerik
namespace:
The following image shows the final result.