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

Stop expand when SelectedItem is set from binding

2 Answers 15 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Buzz
Top achievements
Rank 1
Buzz asked on 09 Apr 2014, 08:36 PM
I bind SelectedItem to my viewmodel.    When an item is selected programmatically, I don't want the treeview to automatically expand to show it.  Later, if the user expands the treeview from the UI, and the selected item is revealed, it should of course be shown as selected.

Is there a built-in way to do this or must I orchestrate it myself in my view model?
I was hoping to find a property like AutoExpandToSelectedItem = false

2 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 14 Apr 2014, 03:20 PM
Hi Buzz,

You can prevent the expanding of the TreeView to the selected item if you set the AutoScrollToSelectedItem property of the RadTreeView to False.

<telerik:RadTreeView  AutoScrollToSelectedItem="False" />
You can also keep in mind that if you set this property to True ‚Äčand the container for the selected item is not yet generated, the item will not be expanded.

Regards,
Martin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Buzz
Top achievements
Rank 1
answered on 16 Apr 2014, 06:48 PM
Thank you
Tags
TreeView
Asked by
Buzz
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Buzz
Top achievements
Rank 1
Share this question
or