Owl's Blog on .NET development

Component Owl codes Better ListView control all night so you don't have to.

List-View Drag and Drop Item Reorder (Sort)

Reordering items in list view control using drag and drop is very tricky. Implementation of item reorder requires multiple issues to be solved:

  • Initialization of the drag & drop
  • Insertion mark that previews where will be the dragged item moved
  • The actual reordering of the items (custom code might be needed)
  • Support of multiple drag drop effects (copy, move, link)
  • It should not interfere with external drag and drop outside of the listview control
  • It should not interfere with internal drag and drop into items.
  • Reorder of multiple items (including non-continuous selection)

Our Better ListView control supports drag and drop item reordering out of the box. Zero code is needed – all you have to do is to set the property BetterListViewItemReorderMode to Enabled.

It works just like this:

Item drag and drop reorder

Item drag and drop reorder

You can just download and install Better ListView, and start using it right away. It can do everything the regular .NET listview component can, and much more.

See more in the Drag Drop Sample that is included with Better ListView. It includes source code.

Leave a Reply