Treeview Drag And Drop (Copy)
Is it possible to copy treenodes between treeviews using drag and drop?
I can easily move a node from tree1 to tree2, but I can't get it to stay in tree1.
I've used example code from: http://www.codeproject.com/vb/net/Tr...ragAndDrop.asp
Changing the e.Effect = DragDropEffects.Move into Copy wasn't enough, and removing the line "dropNode.Remove()" also doesn't work, it makes the drag en drop unresponsive.
Any help would be appreciated.
Re: Treeview Drag And Drop (Copy)
Re: Treeview Drag And Drop (Copy)
You cannot have the same TreeNode in two TreeViews. If you want to copy a node from one tree to another then when it comes time to drop you'll need to Clone your TreeNode and add that to the second tree rather than adding the node that was originally dragged. Either that or create a Clone when the drag starts and make that the Data that is being dragged. I go for the first option though because there's no point Cloning the node if the operation is cancelled part way.
Re: Treeview Drag And Drop (Copy)
Thanks a bunch.
I had already tried assigning them to another treenode and adding that, but that didn't work either ofcourse.