I wanted to copy nodes from a treeviewadv to aother:
- tree1.AddRange(tree2.Nodes) moves the nodes to the first. i.e. nodes disappear from second.
- tree1.InsertRange() same as above.
- tree1.Nodes = tree2.Nodes.Clone() does not work as Nodes collection is read-only.
- tree2.CopyTo() needs a one-dimentional array
- tree1.AddRange (tree2.Nodes.Clone()) does not work
Any other suggestions?
ADAdministrator Syncfusion Team October 8, 2004 05:44 AM
You could acoomplish this as shown below :
foreach (TreeNodeAdv node in this.treeViewAdv1.Nodes.Nodes)
TreeNodeAdv tna = node.Clone();
Please refer to the test sample that illustrates this and let me know if this works for you.
A(Abdulrahman (Ahmad) AlsaleemOctober 8, 2004 07:37 AM
I also modified the code above to yield :
foreach (TreeNodeAdv tmpNode in tree2.Nodes)
tree1.Add(tmNode.Clone() as TreeNodeAdv);
Thanks for the help.
ADAdministrator Syncfusion Team October 8, 2004 08:12 AM
Thanks for the update. Please let me know if you need any other information. Thanks for your continued interest in Syncfusion products.