I want to set backgound of selected row in RadTreeListView. I tried below, but it does not work.
I'm applying a theme to my application using no-xaml. When using a theme, is it not possible to change the background?
<Style TargetType="telerik:TreeListViewRow" BasedOn="{StaticResource TreeListViewRowStyle}">
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="SelectedBackground" Value="#FFFFBB00" />
<Setter Property="Background" Value="#FFFFBB00"/>
</Trigger>
</Style.Triggers>
</Style>
Hello,
Before continuing, could you share the theme that is applied on your end? This will allow me to review the RadTreeListView control's default Style and ControlTemplate for this theme and suggest an approach for achieving the desired behavior.
The SelectedBackground property is not support in RadTreeListView. This is logged in our feedback portal.
To achieve your requirement in the Expression_Dark theme, you can extract and modifying the ControlTemplate of TreeListViewRow.
If you switch to a newer theme - Material or later - you can use the ThemeHelper class and its CheckedBrush attached property, like so:
<Style TargetType="telerik:TreeListViewRow" BasedOn="{StaticResource TreeListViewRowStyle}"> <Setter Property="helpers:ThemeHelper.CheckedBrush" Value="#FFFFBB00" /> </Style>
You can see this shown in the attached project, which uses the Office2019 theme with its Dark color variation applied.