WPF Reflections

Nov 2 2007   4:10PM GMT

Drag and drop by hand



Posted by: MarkWPF
WPF

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

Leave a comment: