This help topic will provide an overview on how you could enable reordering feature of the ListView control when its items are grouped.
Before proceeding, check the Reorder Items topic which describes in details the reordering functionality of the ListView.
When the items of the ListView are grouped by certain criteria and the end user drags/starts reordering an item, the dragged item can be added to a different group. Since this depends on the items' relation, to handle the scenario, you need to subscribe to the ListView
Reorder command and manually update the dragged item details.
ReorderEndedCommandContext gives you access to the following properties:
Item—Refers to the data item that is being interacted with.
DestinationItem—Refers to the data item that corresponds to the location where the dragged item has been released.
Group—Gets the group containing the data item that is being interacted with.
DestinationGroup—Refers to the group that corresponds to the location where the dragged item has been released.
ItemReorderPlacement)—Indicates whether the dragged item should be placed before or after the destination item.
Below you can find a sample implementation.
RadListView definition with the
Reorder command applied:
ViewModel class containing a collection of
Event objects as well as a
Reorder command implementation considering the
Events will be grouped according to the
Day property. Inside the
Reorder command you will have access to some useful details through the
ReorderEndedCommandContext such as:
And the business model:
The following image shows the result: