I have created the following RadTreeView:
<
Style
TargetType
=
"telerik:RadTreeViewItem"
x:Key
=
"RadTreeViewItemStyle"
>
<
Setter
Property
=
"CheckState"
Value
=
"{Binding Path=CheckState, Mode=TwoWay, Converter={StaticResource ToggleStateToBoolean}}"
/>
<
Setter
Property
=
"DefaultImageSrc"
Value
=
"{Binding ListImage}"
/>
<
Setter
Property
=
"IsExpanded"
Value
=
"{Binding IsExpanded}"
/>
<
Setter
Property
=
"IsSelected"
Value
=
"{Binding IsSelected, Mode=TwoWay}"
/>
</
Style
>
<
HierarchicalDataTemplate
x:Key
=
"TreeViewItemTemplate"
ItemsSource
=
"{Binding DirectoryList}"
ItemContainerStyle
=
"{StaticResource RadTreeViewItemStyle}"
>
<
TextBlock
Text
=
"{Binding DisplayName}"
Margin
=
"0,0,5,0"
/>
</
HierarchicalDataTemplate
>
<
telerik:RadTreeView
Grid.Column
=
"0"
IsLineEnabled
=
"True"
ItemsOptionListType
=
"CheckList"
IsOptionElementsEnabled
=
"True"
IsTriStateMode
=
"True"
BorderBrush
=
"Black"
BorderThickness
=
"1"
ItemsSource
=
"{Binding RootItems}"
ItemTemplate
=
"{StaticResource TreeViewItemTemplate}"
IsLoadOnDemandEnabled
=
"True"
LoadOnDemand
=
"RadTreeView_LoadOnDemand"
ItemContainerStyle
=
"{StaticResource RadTreeViewItemStyle}"
Background
=
"White"
Name
=
"ExplorerTree"
>
</
telerik:RadTreeView
>
In the codebehind, I am passing the LoadOnDemand back to my viewmodel for processing. Everything is working exactly as it should except for when I attempt to load a node that has been selected. If I select the node and then fire the LoadOnDemand event, it loads properly and displays all the child nodes, but then deselects the node itself. How can I get it to stop doing this?