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 Delegate Group Descriptor
DelegateGroup descriptor enables you to group by a custom key (for example, some complex expression combining two or more properties) instead of being limited by the value of a single property. This descriptor exposes the following properties:
-
KeyExtractor
—Defines the(Func<object, object)
delegate which returns the property to retrieve the group key for each data item. -
SortOrder
—Defines the sort order in each group to Ascending or Descending.
Let's use the same example from the previous section, and add DelegateGroupDescriptor
through code instead.
1. Define the RadListView
:
2. Include the telerik
namespace:
3. Create and apply a delegate for grouping the items (for example by their first letter) as following:
4. Add a business model:
5. Add a ViewModel
with a collection of Cities:
The following image shows a ListView grouped through the DelegateGroupDescriptor
.
For the ListView DelegateGroupDescriptor example, go to the SDKBrowser Demo Application and navigate to ListView -> Grouping category.