Drag and Drop in bound mode
When RadListView is in bound mode, it does not support drag and drop functionality out of the box due to the specificity of the data source. However, this can be easily achieved by using the built-in ListViewDragDropService. You only need to handle events, emanating from this service.
Figure 1: Drag and drop in bound mode
1. Let’s start with populating the RadListView with data. For this purpose we will create a class Item and fill a BindingList with items:
2. In order to enable the drag and drop functionality, set the RadListView.AllowDragDrop property to true:
3. Use the ListViewElement.DragDropService.PreviewDragStart event to get the dragged item. Subscribe to the ListViewElement.DragDropService.PreviewDragOver event, which allows you to control on what targets the item, being dragged, can be dropped on:
4. The last event we need to handle in our implementation is the ListViewElement.DragDropService.PreviewDragDrop event. This is where we will initiate the actual physical move of the item from one position to another. Implement the handler as follows: