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

Selecting nodes programatically

1 Answer 117 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Phi
Top achievements
Rank 1
Phi asked on 02 Jul 2007, 03:49 AM

Hi,

I want to be able to set the "Selected" property of a node, before I add it to the RadTreeView.

The following code will NOT select the node:

RadTreeNode node1 = new RadTreeNode("node1");
node1.Selected = true;
this.radTreeView1.Nodes.Add(node1);

but if I set the "Selected" property *afterwards*, it will work

RadTreeNode node1 = new RadTreeNode("node1");
this.radTreeView1.Nodes.Add(node1);
node1.Selected = true;

Is this a bug or by design. If by design can you explain the reasoning behind this?

Regards,
Phi Le

1 Answer, 1 is accepted

Sort by
0
Boyko Markov
Telerik team
answered on 03 Jul 2007, 10:25 AM
Hello Phi,

That behavior is by design. You should set the Selected property of RadTreeNode after you have already added the node to a treeview.

If you need more information please write back.

 
Best wishes,
Ray
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Treeview
Asked by
Phi
Top achievements
Rank 1
Answers by
Boyko Markov
Telerik team
Share this question
or