On the gridview when a user enters a filter value, I would like for the background color of that filter to change to a different color (only for the column or columns where a filter has been entered) so that users can quickly see where they entered a filter value.
Currently, if the grid has many columns the user will enter a value (sometimes forget that they did that) and wonder why they have a filtered grid. I know that sounds crazy but end users do that! So, I'd like the Filter Cell Backcolor to be a different color so that it's Obvious that - that particular column has a filter applied to it.
Below, I show the code I'm using in the GridData_ViewCellFormatting event. But the problem is - is that it changes the color for the entire filtering row (across all columns)... whereas I want the back color of the "Filter Cell" to change only for that particular column or columns where a filter has been applied.
It would be greatly appreciated is someone has the answer to solving this 'problem'.
Dim filterDescriptors = GridData.FilterDescriptorsIf TypeOf e.CellElement Is Telerik.WinControls.UI.GridFilterCellElement Then
DirectCast(e.CellElement.RowInfo, Telerik.WinControls.UI.GridViewFilteringRowInfo).Height = 28
e.CellElement.DrawFill = True
e.CellElement.NumberOfColors = 1
e.CellElement.BackColor = Color.Beige
e.CellElement.Font = New Font("Verdana", 10)
For Each filterDescriptor In filterDescriptors
Dim propertyName = filterDescriptor.PropertyName
Dim filterOperator = filterDescriptor.Operator
Dim expression = filterDescriptor.Expression
Dim filterValue = filterDescriptor.Value
If filterValue IsNot Nothing Then
'If e.CellElement.Text = propertyName Then
e.CellElement.BackColor = Color.LightGreen
Exit Sub
'End If
'e.CellElement.BackColor = Color.Pink
End If