WPF Reflections

Oct 29 2007   4:28PM GMT

Drag and drop

Mark Shurmer Profile: MarkWPF

If you find yourself needing to do drag and drop in WPF, and don’t want to do anything fancy try looking at Josh Smith’s drag and drop manager – at http://www.codeproject.com/WPF/ListViewDragDropManager.asp

You use it by declaring a private instance of the DragDropManager with the type of your items:

ListViewDragDropManager<MyDataItem> dragManager;

 Them, create it in your loaded event and attach the ProcessDrop event:

dragManager = new ListViewDragDropManager<MyDataItem>(lv, true);
dragManager.ProcessDrop += new EventHandler<ProcessDropEventArgs<MyDataItem>>(dragManager_ProcessDrop);

and away you go


 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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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: