WPF Reflections

Nov 2 2007   4:10PM GMT

Drag and drop by hand

Mark Shurmer Profile: MarkWPF

Drag and drop in WPF is very similar to that in Windows Forms – very very very similar 🙂 

If you don’t want to use Josh Smith’s great DragDropManager, either because you want to do multi-select or you want to use a data type other than the type used as an item in the listview, here is what you need to do:

  1. The ListView that you want to have items dropped needs to have the property AllowDrop set to true
  2. You need to implement MouseMove event to do the actual drag drop
  3. You need to implement Drop to actually process the result of what to do when the data is dropped

And that is it

 Comment on this Post

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: