|
-
May 22nd, 2006, 07:45 AM
#1
Thread Starter
Lively Member
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.
-
May 23rd, 2006, 01:42 AM
#2
Thread Starter
Lively Member
Re: Treeview Drag And Drop (Copy)
-
May 23rd, 2006, 02:06 AM
#3
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.
-
May 23rd, 2006, 02:50 AM
#4
Thread Starter
Lively Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|