Completed
Last Updated: 06 Jun 2022 12:28 by ADMIN
Release LIB 2022.2.606 (6 Jun 2022)
Stenly
Created on: 10 May 2022 08:19
Category: GridView
Type: Feature Request
0
GridView: Add an API for easier customization of the background color of the HighlightTextBlock element

Currently, to modify the background color of this element, the default control template of the GridViewCell element needs to be extracted, and the VisualState with x:Name="Highlighted" would need to be customized.

We could include an API for modifying the background color of the HighlightTextBlock element, when it is highlighted.

1 comment
ADMIN
Vicky
Posted on: 06 Jun 2022 12:28

Hello,

With the 2022.2.606 LIB version (from 6 Jun 2022), a HighlightedBackground property has been introduced for the GridViewCell element. From this version onwards, the highlighted search results of the GridView can be modified through the HighlightTextBlock's HighlightBrush (foreground) and the cell's HighlightedBackground (background). This can be achieved through two implicit styles for example:

<telerik:RadGridView x:Name="gridView" ShowSearchPanel="True" ItemsSource="12345">
    <telerik:RadGridView.Resources>
        <Style TargetType="telerik:GridViewCell" BasedOn="{StaticResource GridViewCellStyle}">
            <Setter Property="HighlightedBackground" Value="Purple"/>
        </Style>
        <Style TargetType="telerik:HighlightTextBlock" BasedOn="{StaticResource HighlightTextBlockStyle}">
            <Setter Property="HighlightBrush" Value="Lime"/>
        </Style>
    </telerik:RadGridView.Resources>
</telerik:RadGridView>

The BasedOn in the above styles is needed only for the NoXaml version of the assemblies. They can also be defined on app level (App.xaml).

Best Regards,
Vicky
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.