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
- Extract the ControlTemplate of the GridViewCell element.
-
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>
- 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.