This is a migrated thread and some comments may be shown as answers.

drag & drop without removing source node

2 Answers 115 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Atiq Ur Rehman
Top achievements
Rank 1
Atiq Ur Rehman asked on 15 Jan 2009, 02:47 PM
Hi This may be a very stupid question but can you please help me with this? I am using simple drag & drop between two treeview controls example, however I don't want to remove the source node. I have tried removing this line "sourceNode.Owner.Nodes.Remove(sourceNode)" from the code but it still seems to remove the source node when some one drag it to the second treeview.
Can some one please help?

Thanks
Atiq        

2 Answers, 1 is accepted

Sort by
0
Jose
Top achievements
Rank 1
answered on 05 Feb 2009, 05:27 PM
I have the same question !
0
Atanas Korchev
Telerik team
answered on 06 Feb 2009, 07:27 AM
Hello Jose,

Adding a node into a nodes collection removes it from its previous parent. You can use the Clone method to create a copy instead:

RadTreeNode copy = e.SourceDragNode.Clone();
e.DestDragNode.Nodes.Add(copy);

Greetings,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
TreeView
Asked by
Atiq Ur Rehman
Top achievements
Rank 1
Answers by
Jose
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or