The
RadListViewcontrol is obsolete and will be removed in Q2 2026. Use the RadCollectionView control instead. TheRadCollectionViewis a complete, ground-up rewrite of the ListView. TheRadCollectionViewoffers improved performance, enhanced features, and a modernized approach to managing lists of data. TheRadCollectionViewincorporates all of the ListView's key features. More about the differences between both components and how to migrate to the newRadCollectionViewis available in the Migrating the Telerik .NET MAUI RadListView to RadCollectionView article.
.NET MAUI ListView Commands
The Command design-pattern is used in the XAML and MVVM world. The ListView strictly follows the Command design-pattern best practices and provides an intuitive and easy-to-use set of APIs that allow you to control various aspects of ListView behavior.
The ListView exposes a Commands collection that allows you to register custom commands with each control’s instance through the RadListView.Commands property. Commands gets the collection with all the custom commands registered with the CommandService. Custom commands have higher priority than the built-in (default) ones.
Command ID Enumeration
All predefined commands within a RadListView instance are identified by a member of the CommandId enumeration. This member is the key that relates a command instance to a particular action/routine within the owning ListView.
To register a custom command within a RadListView instance you can:
- Inherit from the ListView Command class and override its
CanExecuteandExecutemethods. - Use the ListView User Command class and bind its Command property to a
Commandin yourViewModel.
In both cases, you need to set the Id property of the new command so that it can be properly associated with the desired action/event.
Each command has a context object of type [CommandId]CommandContext. The available commands and their context are described in the table below:
| Commands | Object type |
|---|---|
ItemTap | ItemTapCommandContext |
ItemHold | ItemHoldCommandContext |
ItemSwiping | ItemSwipingCommandContext |
ItemSwipeStarting | ItemSwipeStartingCommandContext |
ItemSwipeCompleted | ItemSwipeCompletedCommandContext |
PullToRefreshRequested | PullToRefreshRequestedCommandContext |
SelectionChanged | SelectionChangedCommandContext |
LoadOnDemand | LoadOnDemandCommandContext |
GroupHeaderTap | GroupHeaderContext |
ReorderStarting | ReorderStartingCommandContext |
ReorderEnded | ReorderEndedCommandContext |
Commands action correspond to the events exposed by the ListView. For more details, see the Events topic.
The context object is passed as a parameter in its Execute method and provides information identical to the corresponding event arguments.
When overriding the
ReorderEndedandGroupHeaderTapcommands you have to implement the action each command does. For example, manually reorder items and manually update the groupIsExpandedstate.