We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Copying Nodes from TreeViewAdv to another

Thread ID:





20024 Oct 7,2004 10:51 PM UTC Oct 8,2004 01:12 PM UTC WinForms 3
Tags: Tools
Abdulrahman (Ahmad) Alsaleem
Asked On October 7, 2004 10:51 PM UTC

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? Thanks

Administrator [Syncfusion]
Replied On October 8, 2004 10:44 AM UTC

Hi Ahmad, You could acoomplish this as shown below : foreach (TreeNodeAdv node in this.treeViewAdv1.Nodes[0].Nodes) { TreeNodeAdv tna = node.Clone(); this.treeViewAdv2.Nodes[0].Nodes.Add(tna); } Please refer to the test sample that illustrates this and let me know if this works for you. Regards, Guru Patwal Syncfusion, Inc.

Abdulrahman (Ahmad) Alsaleem
Replied On October 8, 2004 12:37 PM UTC

Got it. I also modified the code above to yield : foreach (TreeNodeAdv tmpNode in tree2.Nodes) { tree1.Add(tmNode.Clone() as TreeNodeAdv); } Thanks for the help.

Administrator [Syncfusion]
Replied On October 8, 2004 01:12 PM UTC

Hi Ahmad, Thanks for the update. Please let me know if you need any other information. Thanks for your continued interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon