New to Telerik UI for WPF? Download free 30-day trial

Remove Cell Background Highlighting When Searching as you Type

Environment

Product Version 2019.1.220
Product RadGridView for WPF

Description

How to remove or change the background of a matching cell when you search as you type.

Solution

  1. Extract the ControlTemplate of the GridViewCell element.
  2. In the ControlTemplate, find the VisualState with x:Name set to "Highlighted".

        <VisualState x:Name="Highlighted"> 
            <Storyboard> 
                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="PART_CellBorder" Storyboard.TargetProperty="Background"> 
                    <DiscreteObjectKeyFrame KeyTime="0"> 
                        <DiscreteObjectKeyFrame.Value> 
                            <SolidColorBrush Color="#2B00BFE8"/> 
                        </DiscreteObjectKeyFrame.Value> 
                    </DiscreteObjectKeyFrame> 
                </ObjectAnimationUsingKeyFrames> 
            </Storyboard> 
        </VisualState> 
    
  3. Remove the Storyboard that targets the "PART_CellBorder" from the VisualState. If you want only to change the color instead of removing it, change the Color property of the SolidColorBrush element.

This example is based on the Fluent theme. The ControlTemplate content could vary accross the different themes.

See Also

In this article