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

Node selected on page load

6 Answers 133 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Rubihno
Top achievements
Rank 1
Rubihno asked on 08 Oct 2008, 06:40 AM
Hi,

How i make to select automatically a node when start page?For example a first node that find...
Because the treeview when page start the node is not yet selected..i would like to select automatically a node..

6 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 08 Oct 2008, 07:34 AM
Hi Rubihno,

Here is one solution: On Page_Load event find the node and set its Selected property to True.

Regards,
Veselin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Rubihno
Top achievements
Rank 1
answered on 08 Oct 2008, 12:59 PM
I tried with this code..but dont'run...there are error..

 Dim selectednode As RadTreeView = New RadTreeView()

        selectednode.Nodes.FindNodeByValue(1).Selected = True
0
Veselin Vasilev
Telerik team
answered on 08 Oct 2008, 01:04 PM
Hello Rubihno,

The FindNodeByValue method accepts a parameter of type String.
Please change your code to:

selectednode.FindNodeByValue("1").Selected = true

Also, note that I have removed the .Node from your left side example, because in that way it will search only among the root nodes. Now it will search among all nodes.

Regards,
Veselin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Rubihno
Top achievements
Rank 1
answered on 08 Oct 2008, 02:53 PM
i have this error:

 selectednode.FindNodeByValue("1").Selected = True

Object reference not set to an instance of an object.




0
Veselin Vasilev
Telerik team
answered on 09 Oct 2008, 02:48 PM
Hello Rubihno,

I think the best way to proceed is to open a support ticket and send us a small running project demonstrating the problem.

Thanks

Kind regards,
Veselin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Rubihno
Top achievements
Rank 1
answered on 10 Oct 2008, 12:09 PM
ok..thanks
Tags
TreeView
Asked by
Rubihno
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Rubihno
Top achievements
Rank 1
Share this question
or