I set the SelectedBackground property, but it didn't work. I hope you can tell me what to do?
Stenly
Telerik team
commented on 01 Aug 2024, 07:37 AM
Hello YunFan,
May I ask if you could share a bit more information about this case? More specifically, what is the used theme on your end? This way, I will review the default style for the TreeListViewRow for the theme that you use and share possible solutions for achieving the desired behavior.
The theme is CrystalTheme and the version is 2022.2.511.60
Stenly
Telerik team
commented on 02 Aug 2024, 11:53 AM
Hello YunFan,
For the Crystal theme, the selected color of the TreeListViewRow element is controlled by the MaterialAssist.CheckedBrush attached property.
With this in mind, to change the selected color, create a new Style with TargetType="TreeListViewRow" and add a new Setter for the MaterialAssist.CheckedBrush property and set it to the desired color.
The namespace for the MaterialAssist class is as follows:
The following code snippet shows this suggestion's implementation:
<!--If NoXaml assemblies version is used: BasedOn="{StaticResource TreeListViewRowStyle}"--><StyleTargetType="telerik:TreeListViewRow"><SetterProperty="mat:MaterialAssist.CheckedBrush"Value="red"/></Style>
The following code snippet shows the produced result:
I hope the provided information will be of help to you.
Hello YunFan,
May I ask if you could share a bit more information about this case? More specifically, what is the used theme on your end? This way, I will review the default style for the TreeListViewRow for the theme that you use and share possible solutions for achieving the desired behavior.
Hello YunFan,
For the Crystal theme, the selected color of the TreeListViewRow element is controlled by the MaterialAssist.CheckedBrush attached property.
With this in mind, to change the selected color, create a new Style with TargetType="TreeListViewRow" and add a new Setter for the MaterialAssist.CheckedBrush property and set it to the desired color.
The namespace for the MaterialAssist class is as follows:
xmlns:mat="clr-namespace:Telerik.Windows.Controls.MaterialControls;assembly=Telerik.Windows.Controls"
The following code snippet shows this suggestion's implementation:
<!--If NoXaml assemblies version is used: BasedOn="{StaticResource TreeListViewRowStyle}"--> <Style TargetType="telerik:TreeListViewRow"> <Setter Property="mat:MaterialAssist.CheckedBrush" Value="red"/> </Style>
The following code snippet shows the produced result:
I hope the provided information will be of help to you.