I have this situation! I have a MVVM application and the code for the tree:
When I refresh the tree I want to select the previous item and expand it downto the level where this item resides.
Luka
<
telerik:RadTreeView
IsExpandOnSingleClickEnabled
=
"True"
ItemsSource
=
"{Binding DLYReasons, Mode=TwoWay}"
SelectedItem
=
"{Binding SelectedTreeItem, Mode=TwoWay}"
>
<
telerik:RadTreeView.ItemContainerStyle
>
<
Style
TargetType
=
"{x:Type telerik:RadTreeViewItem}"
>
<
Setter
Property
=
"FontWeight"
Value
=
"Normal"
/>
</
Style
>
</
telerik:RadTreeView.ItemContainerStyle
>
<
telerik:RadTreeView.ItemTemplate
>
<
HierarchicalDataTemplate
ItemsSource
=
"{Binding ChildElements}"
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
Border
MaxHeight
=
"20"
MaxWidth
=
"20"
MinHeight
=
"20"
MinWidth
=
"20"
Background
=
"{Binding ImageResourceId, Converter={StaticResource valueToStaticResource}, ConverterParameter={StaticResource StaticResourceValuesTreeShape}}"
/>
<
Label
Content
=
"{Binding ReasonCode}"
></
Label
>
</
StackPanel
>
</
HierarchicalDataTemplate
>
</
telerik:RadTreeView.ItemTemplate
>
</
telerik:RadTreeView
>
When I refresh the tree I want to select the previous item and expand it downto the level where this item resides.
Luka