Question

Been trying to find a working implementation of a WPF listview (or listbox) where you can order items by dragging them up or down.

I have found a few, but none really works, for example this one http://www.codeproject.com/KB/WPF/ListViewDragDropManager.aspx?msg=2765618#xx2765618xx stops working once you have list where you need to scroll down to get to the last items.

Why is Drag&Drop so hard in WPF? Does anybody know a working control?

Was it helpful?

Solution

Drag&Drop is not SO hard, really :)

Try reading this post about Drag&Drop.

OTHER TIPS

Also check out this article on CodeProject!

It is not as full featured as Josh & Bea's implementation but it is very simple to use...

This implementation rely on attached properties (Attached behaviour)

Source

<ListBox src:DragAndDrop.DragEnabled="true"/> 

Target

<ListBox src:DragAndDrop.DropEnabled="true"/> 

I've been struggling with WPF drag and drop for a while now and decided to just bite the bullet and create a framework for it.

You can find the code here: http://code.google.com/p/gong-wpf-dragdrop/

I’d love to get some feedback on this, hopefully it will solve your problem!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top