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

Change Column Style When Filtered

5 Answers 6 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 30 Apr 2014, 08:25 AM
Hi

Does anyone know how to change the column style when a column is filtered, in a similar way to when you sort a column?

I have a number of grids which are loaded with default filters and it would be nice if I can highlight somehow which filters are already applied when a grid loads.

If it is not possible to change the column style then some other form of highlighting, such as the filter textbox style, would work just as well.

Thanks in advance for any help

Cheers
Rob

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 30 Apr 2014, 08:33 AM
Hi Rob,

You can try the following code snippet to highlight the filtered column.

C#:
protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
  if (e.CommandName == RadGrid.FilterCommandName)
  {
    Pair filterPair = (Pair)e.CommandArgument;
    string FilteredColumn = filterPair.Second.ToString();
    RadGrid1.MasterTableView.GetColumn(FilteredColumn ).ItemStyle.BackColor = Color.Yellow;
  }
}

Thanks,
Princy
0
Pavlina
Telerik team
answered on 30 Apr 2014, 03:07 PM
Hi Rob,

I am happy to inform you that we have planned to implement the desired functionality for one of the upcoming releases. When a column is filtered in the Grid, the funnel button will change its state.

Regards,
Pavlina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Rob
Top achievements
Rank 1
answered on 30 Apr 2014, 04:14 PM
Many thanks Princy for your quick response. I'm just about to give your suggestion a try.

Cheers
Rob
0
Rob
Top achievements
Rank 1
answered on 30 Apr 2014, 04:19 PM
Hi Pavina

Many thanks for the great news that this is going to be a standard feature in a future release. Do you have any idea of when this is likely to be included?

Cheers
Rob
0
Pavlina
Telerik team
answered on 30 Apr 2014, 09:15 PM
Hi Rob,

We will try to include this feature for the next Q2 2014 release of the controls or at least for the Q2 2014 SP1.

Regards,
Pavlina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Rob
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Pavlina
Telerik team
Rob
Top achievements
Rank 1
Share this question
or