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

[Solved] ChildNodes

3 Answers 156 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Mohamed
Top achievements
Rank 1
Mohamed asked on 20 Apr 2008, 02:07 PM
hi all
in microsoft treeView i find proprety named ChildNodes

TreeNode

NewNode = new TreeNode(ThisName , ThisID.ToString());
NewNode.ChildNodes

i cann't find it in radtreeview


RadTreeNode

newNode = new RadTreeNode(ThisName, ThisID.ToString());

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 21 Apr 2008, 07:25 AM
Hello Mohamed,

In RadTreeView you can use the Nodes property of the RadTreeNode object.

Kind regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Mohammad Bourisly
Top achievements
Rank 1
answered on 21 Apr 2008, 07:35 AM
Dear Albert
i want to pupulate my tree in code this is method

private void BuildTreeView(RadTreeNodeCollection nodes, Guid IntParent)
        {
                       
            Guid ThisID;
            String ThisName;
            IPredicate filter;
            var enCollection = new EntityCollection<GLChartOfAccountEntity>();
            BL.GL.FillChartOfAccount(enCollection, null);

            filter = (GLChartOfAccountFields.ParentAccountNo == IntParent);         

            var children = new EntityView2<GLChartOfAccountEntity>(enCollection, filter);

            // no child nodes, exit function
            if (children.Count == 0) return;

            foreach (GLChartOfAccountEntity child in children)
            {
                ThisID = child.AccountNo;
                ThisName = child.ENAccountName;

                RadTreeNode newNode = new RadTreeNode(ThisName, ThisID.ToString());

                nodes.Add(newNode);
                newNode.Toggle();

// here is problem
                BuildTreeView(newNode, ThisID.ToString());
            }
        }


in microsoft tree i call it like BuildTreeView(newNode.ChildNodes, ThisID.ToString());

what is the same in radtreeview ?

0
Atanas Korchev
Telerik team
answered on 21 Apr 2008, 10:35 AM
Hello Mohammad Bourisly,

You can use the Nodes property to access the child nodes of RadTreeView or RadTreeNode objects:

BuildTreeView(newNode.Nodes, ThisID.ToString());

Regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
TreeView
Asked by
Mohamed
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Mohammad Bourisly
Top achievements
Rank 1
Share this question
or