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.
Unfortunately, activation email could not send to your email. Please try again.

Copying Nodes from TreeViewAdv to another

Thread ID:

Created:

Updated:

Platform:

Replies:

20024 Oct 7,2004 06:51 PM Oct 8,2004 09:12 AM Windows Forms 3
loading
Tags: Tools
Abdulrahman (Ahmad) Alsaleem
Asked On October 7, 2004 06:51 PM

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 06:44 AM

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 08:37 AM

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 09:12 AM

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.

CONFIRMATION

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.

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.

;