We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to change the FilterToggleButton color while filtering?

In SfDataGrid, FilterToggleButton is present in the Column Header that is used to open the Filter Pop up window. The appearance of FilterToggleButton is customized by using FilterToggleButton control template that have two visual state: Filtered and UnFiltered respectively. When the Filter is applied then the Filtered visual state is applied to the FilterToggleButton else UnFiltered visual state is applied. The Default style is applied to the FilterToggleButton.

In this section, you can learn how to change the FilterToggleButton color after filtering and create the custom style for FilterToggleButton. PathFillColor is the SolidColorBrush applied to the FilterToggleButton. When the Filter is applied then the PathFillColor is changed to Red else PathFillColor is changed to Gray. Refer the following code example,

XAML

 

C:\Users\labuser\Desktop\note.jpgNote: Refer the following code example for customize the FilterToggleButton Color in WinRT.

 

 

Note: The above code snippet is only applicable for WinRT. For other platforms refer respective samples.

Refer the following screenshot for change the FilterToggleButton color after Filtering,

In the above screenshot, Filter is applied to the Name column and the FilterToggleButton color in Name column is changed to Red.

Sample Links:

WPF

WRT

SilverLight

UWP

Article ID: Published Date: Last Revised Date: Platform: Control: .NET Framework:
2483 08/12/2014 01/25/2016 Silverlight SfDataGrid 4.5
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.