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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to better show filtered columns to the user ?

Thread ID:

Created:

Updated:

Platform:

Replies:

123455 Mar 18,2016 02:19 PM UTC Mar 21,2016 12:00 PM UTC WPF 1
loading
Tags: SfDataGrid
Silvio
Asked On March 18, 2016 02:19 PM UTC

Hi,

Is it possible in SfDataGrid to dinamically change the header background color of a column as soon as this column becomes filtered so that it is more evident to the user ?

Silvio

Attachment: syncfusion_(2)_ccf25a23.zip

Jayapradha S [Syncfusion]
Replied On March 21, 2016 12:00 PM UTC


Hi Silvio,

Thank you for contacting Syncfusion Support.

We have analyzed your requirement. You can change the column header background when applying filter to that column by using SfDataGrid.FilterChanged event as shown below,

Code Example:
this.datagrid.FilterChanged += datagrid_FilterChanged;  

void datagrid_FilterChanged(object sender, GridFilterEventArgs e)

        {

            if (e.FilterPredicates != null && e.FilterPredicates.Count > 0)

                e.Column.HeaderStyle = App.Current.FindResource("headerStyle") as Style;

            else

                e.Column.HeaderStyle = new Style();        
        }

<Style x:Key="headerStyle" TargetType="Syncfusion:GridHeaderCellControl">

            <Setter Property="Background" Value="Green" />

</Style>


We have prepared a sample for your requirement and please find the sample from the following location,
Sample Link: http://www.syncfusion.com/downloads/support/forum/123455/ze/Filter_Changed_123455-674810504  

Regards,
Jayapradha


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon 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.Close Icon

;