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

Toggle filter function

2 Answers 97 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pieter
Top achievements
Rank 1
Pieter asked on 20 May 2010, 10:09 AM

Hello,

We want to implement the following with the RadGrid.

If the user clicks the filter icon, the filter expression 'contains' is being executed. The filter icon changes. A filter icon with an angled red line through is being showed. If the user then click the filter icon the expression 'nofilter' is being executed and the original filter icon gets back.

In fact we want a toggle filter per column.

How can we implement this?

Regards,
Pieter

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 20 May 2010, 11:16 AM
Hello Pieter,

You can achieve this by making advantage of FilterTemplate with ImageButton inside. In the OnClick event of ImageButton, set/clear the Filter explicitly. The following code shows how to set the filter from code behind.
Applying default filter on initial load


I hope this suggestion helps,
Shinu.
0
Pieter
Top achievements
Rank 1
answered on 21 May 2010, 09:59 AM
Hello,
In the end we've choosen yet another, even better solution also in line with the implemented functionality of the RadGrid and maintainability. In the CommandItemTemplate we've added a button that allows all filters can be removed. It is only enabled if at least one filter field is filled in.
Regards,
Pieter
Tags
Grid
Asked by
Pieter
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Pieter
Top achievements
Rank 1
Share this question
or