I posted a reply in the support thread you started but I will post the same information here as well, in case anyone else from the community encounters the same issue.
tries to bring every selected item into view. However, it won't be able to bring into view an item that hasn't been loaded. And it is important to note that the RadTreeView
control loads/initializes its items only when they are displayed (expanded) - which explains why a selected item is brought into view only if its path was previously expanded.
However, there isn't a built-in feature or a method that allows you to change that behavior easily. But we can offer workarounds. For example, you can virtualize your RadTreeView
control to disable the BringIntoView
feature. When the RadTreeView
control is virtualized, it only prepares containers for the visible and expanded items. This is why when you collapse the path to an item, even if you select the item, the BringIntoView()
method won't be able to find generated containers for the parent items of the selected node and the items will remain collapsed. If you decide to use this as a workaround you can simply bind the TreeViewPanel
property to a property from your MainViewModel
and control the value of the property through a custom logic(or a CheckBox
Another approach that you can use is to create a static property in your MainViewModel
(let's say it's named IsExpansionSuppressed
) and use its value to deny a change in the expanded state of the RadTreeViewItems
. You can implement this scenario in an MVVM application where the RadTreeViewItem IsExpanded
property is data bound to a business property. And you can use the MainViewModel
static property to stop a change in the expanded business property setter. In case you'd like to use this approach, it is important to make sure to set the IsExpansionSuppressed
property to True
just before selecting a designated item and you need to set the IsExpansionSuppressed
back to False
, as soon as the selection is changed.
Basically if you use a button Click event handler to select an item, you can implement the following logic:
// select 0.1.1.2
sender, RoutedEventArgs e)
MainViewModel vm =
DataItem item = (
And the DataItem class (that describes the RadTreeViewItem data) should contain the following Expanded property setter:
._expanded != value)
._expanded = value;
I hope this information helps.
the Telerik team