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

how can i add/copy a node to two parents

2 Answers 39 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
randall
Top achievements
Rank 1
randall asked on 17 Dec 2014, 10:24 PM
Hi, i need to know how to create/copy a node to a different parent.
in my tree structure i have a root and groups. when i'm  down inside a group i also want to make a copy of the node and add it to a different group.

in my code i have this which add the pending user node to the GroupNode.

                    RadTreeNode nodePending = new RadTreeNode()
                    {
                        Value = group.Id.ToString() + "|" + invitation.Id.ToString(),
                        ForeColor = System.Drawing.Color.Gray
                    };

                   GroupNode.Nodes.Add(nodePending);

i would like to add "nodePending" to a different group which was create here in a different loop

                RadTreeNode nodeUser = new RadTreeNode()
               {
                Text = "(Users)",
               };

the problem is if i use the following code below it does not like me putting in "nodeuser.Nodes.add"

                   nodeUser.Nodes.Add(nodePending);


suggestions?




2 Answers, 1 is accepted

Sort by
0
randall
Top achievements
Rank 1
answered on 18 Dec 2014, 07:33 PM
anyone have a suggestion?
0
Peter Filipov
Telerik team
answered on 22 Dec 2014, 12:33 PM
Hi Randall,

I am not quite sure what you want to achieve. Could you please isolate the case into a runnable page and send it back. One suggestion is to store the created node to a global variable which you could access in the second loop.

Regards,
Peter Filipov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
TreeView
Asked by
randall
Top achievements
Rank 1
Answers by
randall
Top achievements
Rank 1
Peter Filipov
Telerik team
Share this question
or