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

Perform filter action on RadGrid filter icon click event

1 Answer 249 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Karl
Top achievements
Rank 1
Karl asked on 16 Aug 2011, 12:56 PM
Hi all..

Not sure if this is possible but have to ask.

We have a RadGrid with filtering enabled, and I have used previous posts to limit the options available, but now our client would like be able to simply type a value into the field and click the icon to perform a contains filter, without having to select the filter type.

I can personally see many issues with this (Dates, numerics etc as well as how to clear the filter - other than clearing the value and re-filtering?) but need to know if it can be done.

1 Answer, 1 is accepted

Sort by
0
Karl
Top achievements
Rank 1
answered on 17 Aug 2011, 10:32 AM
Ok, so it can be done...

Set ...

AutoPostBackOnFilter="true" 
CurrentFilterFunction="Contains"

...on each column you want to have the filter performed on.

I also hid the filter icon by using the following css and put it in my page after the skin stylesheets in my html...

<style type="text/css">  
    .RadGrid .rgFilter,  
    .GridFilterRow_Gray img  
    {  
        display: none;  
    }  
</style>

So now my filter works for my chosen fields. How do I clear my filters now that the filter is no longer accessible? I simply remove the text from the filter textbox and hit return again, right?

Kind of.

I have to ensure I've come out of the filter textbox and gone back into it again, or I get some funny behaviour.

If I leave my cursor in the filter textbox and delete the filter text and then hit return/enter, it only sometimes clears the filter, most of the time, it doesn't work.

If this a known issue, or can anyone think of why this would be?

Tags
Grid
Asked by
Karl
Top achievements
Rank 1
Answers by
Karl
Top achievements
Rank 1
Share this question
or