Search code examples
vb.netwinformstelerikradlistview

Telerik RadListView EnableSorting overrides AllowDragDrop


I'm using Telerik UI for Winforms version 2015.1.331.40. I have a Telerik RadListView of string values that the end user would like to be able to sort via column header and drag-and-drop. This doesn't appear to be possible, though.

Is there any way to enable both AllowDragDrop and EnableSorting on a RadListView control? I've tried setting both options to True, but it appears that if EnableSorting is True, there's no way to flip AllowDragDrop to True. Even if I set it programmatically, like

radList.AllowDragDrop = True

the actual value of AllowDragDrop in the Watch window at the next line of code is False.

I've looked into the Telerik documentation and haven't found anything definitive yet. I did try the example provided at this URL, but AllowDragDrop stayed False so none of the associated events were raised. I've googled and poked around StackOverflow as well. I may have missed something, and if that's the case, I apologize for not digging far enough.

I don't have to use this control; I can use another one if it's a better fit. This seemed to be the best option (at first).


Solution

  • I don't think that both options can work together. When you enable sorting, the control will arrange the items in certain order, according to the sorting rule, hence drag and drop is not possible as it implies changing the items order despite the sorting rule.

    What you can try is to disable the sorting of the control and enable drag and drop and sort the items in the Items collection as you see it fit.