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 customize the Filtering and Sorting icons in the SfDataGrid ?

You can customize the appearance of Filter and Sort icon of SfDataGrid by override the styles of FilterToggleButton and GridHeaderCellControl. And change the appearance of filter popup by override the style of GridFilterControl.

Customize the appearance of Sort icon

The appearance of sort indicator can be customized by override the style of GridHeaderCellControl. Under the PART_SortButtonPresenter, you can change its path value to specify expected customized appearance for both Ascending and Descending sort icons. Refer the below code, here the sort icon default color is changed from Gray to Red.

 

Customize the appearance of Filter icon

The appearance of filter icon can be customized by override the FilterToggleButton style. Refer the below code, here the filter icon default color is changed from Gray to Red and the height of filter icon is changed the default value to 14.

 

The following screenshot displays the customized Filter and Sort icon of GridHeaderCellControl in SfDataGrid.

 

Customize the appearance of Filter-Popup

You can customize the appearance of filter popup by overriding the style of GridFilterControl. Under the PART_OkButton and PART_CancelButton, you can change the appearance for both buttons. Refer the below code, here the filter popup button default background color is changed from Transparent to LightBlue and Foreground color is changed from Gray to Red.

 

Sample: CustomizeFilterandSortingIcon

Article ID: Published Date: Last Revised Date: Platform: Control: .NET Framework:
8184 11/24/2017 12/06/2017 WPF SfDataGrid 4.5.1
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.