This is a migrated thread and some comments may be shown as answers.

How to change column header colour if filter is applied?

3 Answers 352 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kamila
Top achievements
Rank 1
Kamila asked on 08 Nov 2012, 02:30 PM
Hi

I have a lot of columns and my users have a problem to find filtered columns.

They have a problem becouse then don't see that icon "filter" changed color.


Kamila

3 Answers, 1 is accepted

Sort by
0
Emanuel Varga
Top achievements
Rank 1
answered on 08 Nov 2012, 02:39 PM
Hello,

To achieve this you will need 2 different things, first you will have to handle the ViewCellFormatting event described in this thread, with a slight modification, instead of using the MouseMove event, you should check if the column corresponding to the current cell is being sorted on or not. You can find out how to get the current sort descriptors as explained in this thread

Hope this helps, if you have any other questions, please let me know.

Best Regards,
Emanuel Varga
WinForms MVP
0
Kamila
Top achievements
Rank 1
answered on 08 Nov 2012, 02:49 PM
Thank you for very very very very quick response :-)

You write about "cell is being sorted on or not".

I hope so that in similar way i will check if cell is filtered or not. Because I need change color of column header when filter is applied - not when id sorted.
But ... it It also may be useful to me :-)
I can color header when user sort, filter or both

Kamila
0
Accepted
Emanuel Varga
Top achievements
Rank 1
answered on 08 Nov 2012, 03:11 PM
Hello,

Yes, it is almost the same, it is just named FilterDescriptor (http://www.telerik.com/help/winforms/gridview-filtering-setting-filters-programmatically-simple-descriptors.html).

Sorry for the confusion...

Best Regards,
Emanuel Varga
WinForms MVP
Tags
GridView
Asked by
Kamila
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Kamila
Top achievements
Rank 1
Share this question
or