I'm new to WPF and Telerik UI for WPF. I'm using telerik's RadTreeview
Somehow, i have added style custom style but i'm unable to added Hovering effect and also selected effect in RadTreeview.
There are many examples, but its main for basic treeview. Tried adding content template.. it fails to load parent or child node..
Can anyone help me out in this.
Thanks in advance...!!!
Below is my custom style for RadtreeviewItem
<Style x:Key="myItemContainerStyle" TargetType="telerik:RadTreeViewItem">
<Setter Property="Background" Value="#2199e8"/>
<Setter Property="Foreground" Value="#ffffff"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Padding" Value="20 5"/>
<Setter Property="FontSize" Value="20"/>
<Setter Property="IsExpanded" Value="False"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="BorderBrush" Value="#adc6e5"/>
<Setter Property="Foreground" Value="Black" />
<Setter Property="Background" Value="Red" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" Value="LightBlue" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="Background" Value="Red" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="True"/>
<Condition Property="IsSelectionActive" Value="False"/>
</MultiTrigger.Conditions>
<Setter Property="BorderBrush" Value="LightGray"/>
</MultiTrigger>
</Style.Triggers>
<Style.Resources>
<Style TargetType="Border">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Style.Resources>
</Style>
Because of the definition of the default
ControlTemplate, I am afraid you can't solve this with style triggers. You need to create a complete customControlTemplateand modify theMouseOverVisual,SelectionUnfocusedVisualandSelectionVisualBorderelements according to your requirements: