Drag and drop between ListBox/ItemsControl to TreeView

125 views
Skip to first unread message

Artyom Grigor

unread,
Mar 22, 2010, 6:25:53 PM3/22/10
to gong-wpf-dragdrop
Hi all!
I'm a new in this group, so sorry for my maybe stupid question.
I want to make drag and drop bwtween ListBox/ItemsControl to TreeView.
I added folloing to my controls:
dd:DragDrop.IsDragSource="True" dd:DragDrop.IsDropTarget="True"

but when I try to drag I can't drop into ListBox.
Could you help me?

gro...@googlemail.com

unread,
May 4, 2010, 12:54:49 PM5/4/10
to gong-wpf-dragdrop
Hi Artyom,

For some reason I didn't get an email notifying me of your question so
I've only just seen it.

You need to add a DropHandler - the default DropHandler can only
handle the case where the source and destination items are of the same
type.

See http://www.codeproject.com/KB/WPF/gong-wpf-dragdrop-ii.aspx for an
explanation.

Cheers,
Steven
Reply all
Reply to author
Forward
0 new messages