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

ensure visible and select node

5 Answers 266 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
liat even
Top achievements
Rank 1
liat even asked on 16 Nov 2009, 01:54 PM
Hello,

I am building a tree programmatically. After adding all of the items i would like to select one of them and to scroll to it (ensure that it is visible). i am using the node object (RadTreeViewItem) to set the IsSelected property to true, and then use the EnsureVisible method. The node is indeed selected. However any methods that are registered to the Selected event are not invoked. In addition, the item stays invisible and manual scrolling is required. 

Any ideas?

thanks,
Liat.

5 Answers, 1 is accepted

Sort by
0
Ivan
Telerik team
answered on 18 Nov 2009, 01:56 PM
Hi Liat,

About selecting and showing the item please preview the Expanding a Databound TreeView initially article. There is a working example too.

About the selected event please note if the container is not constructed then the Selected event is not raised. Instead you can rely on the SelectionChanged event of the TreeView control.

Sincerely yours,
Ivan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
GiWorking
Top achievements
Rank 1
answered on 22 Aug 2012, 05:25 PM
The solution is missing, the link does not function.
I would appreciate to see it.
0
Tina Stancheva
Telerik team
answered on 22 Aug 2012, 05:38 PM
Hello Jean-Marc,

This is an old thread and the link and the approach it described, don't work anymore. Instead, you can have a look at this blog post describing the RadTreeView.BringPathIntoView method. If you need to bring virtualized items into view, this method is your best choice. As the solution attached in the blog is targeting Silverlight, I've attached its WPF version here.

All the best,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
GiWorking
Top achievements
Rank 1
answered on 22 Aug 2012, 05:49 PM
Hello Tina,
Do you have a wpf version of this example that you from this blog :
http://blogs.telerik.com/xamlteam/posts/11-01-12/treeview-bringintoview.aspx
I do not have silverlight.
thanks

Jean-Marc

I wish to thank you for the code you sent me, I found a solution to that works fine with the IEventAggregator.

Thanks,
0
Tina Stancheva
Telerik team
answered on 23 Aug 2012, 04:48 PM
Hello Jean-Marc,

I'm glad the solution helps. Let me know if I can further assist you.

All the best,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
TreeView
Asked by
liat even
Top achievements
Rank 1
Answers by
Ivan
Telerik team
GiWorking
Top achievements
Rank 1
Tina Stancheva
Telerik team
Share this question
or