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

Highlight a node selected by code

3 Answers 155 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Juan Pablo
Top achievements
Rank 1
Juan Pablo asked on 30 Jan 2009, 01:53 PM
Hello experts!

I have an application where there are 2 treeviews, each one is in a tab item.
When I do a double click in one of the nodes of the second treeview, the application search for it's twin in the first node and show some information in the form.
The application is finding the node, is expanding the treeview and scrolling to show the node (I'm using treeview1.bringintoview(node) functionality). But I need to the node get's highlighted as if it was selected with the mouse.

Please help me with this, I've worked on this for hours and can't get any solution. I've also used the treevie1.setfocus(node), but it doesn't work.

Thanks in advance.

3 Answers, 1 is accepted

Sort by
0
Juan Pablo
Top achievements
Rank 1
answered on 30 Jan 2009, 02:18 PM
Nevermind ... I changed the order of some code lines and it worked ...

Thanks!
0
Christian
Top achievements
Rank 1
answered on 20 Jul 2009, 06:59 PM
Hi,
I have a similar problem and still no solution. For a tip, I would be grateful.
Christian


0
Nikolay
Telerik team
answered on 23 Jul 2009, 03:26 PM
Hi Christian,

In order to achieve the desired functionality, you should simply use the following code snippet:
this.radTreeView2.BringIntoView(searchedNode);  
this.radTreeView2.SelectedNode = searchedNode; 

The searchedNode is the RadTreeNode of interest.

If you have additional questions, feel free to contact me.

Kind regards,
Nikolay
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Treeview
Asked by
Juan Pablo
Top achievements
Rank 1
Answers by
Juan Pablo
Top achievements
Rank 1
Christian
Top achievements
Rank 1
Nikolay
Telerik team
Share this question
or