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

How can I filter on key press but not on the filter button click?

3 Answers 28 Views
Filter
This is a migrated thread and some comments may be shown as answers.
J
Top achievements
Rank 1
J asked on 22 Oct 2013, 01:33 PM
My filters use AutoPostBackOnFilter=true to capture the [Enter] key, as shown here:

http://www.telerik.com/help/aspnet-ajax/grid-search-on-key-press.html

This is great for having a quick default filter option, but what about when I want to use a different filter option? What happens right now is essentially two filters to use one. To clarify, let's assume I have things set up so that [Enter] defaults to a "Contains" filter, and I do the following:

1. Enter some text into a filter text box.
2. Click the filter button, because I do not want to do a "Contains" filter. The grid posts because the filter text box has lost focus.
3. The filter drop down has disappeared, so I click it again. Now I can select the filtering option I want, e.g., "Between".

As you can see, I have to do to the default filter every time I want to do an alternative filter option. How can I avoid this?

Thanks.

3 Answers, 1 is accepted

Sort by
0
J
Top achievements
Rank 1
answered on 22 Oct 2013, 02:05 PM
In case I was unclear, I would still like to be able to hit [Enter] to to default to "Contains", but I would like to be able to select a different filter option (using the filter button) without doing the double filter/post back thing.
0
Accepted
Eyup
Telerik team
answered on 25 Oct 2013, 10:18 AM
Hello,

You can implement the approach suggested in the following thread:
http://www.telerik.com/community/forums/aspnet-ajax/grid/force-a-filter-to-be-applied-on-enter-key.aspx

Hope this helps. Please give it a try and let me know if it works for you.

Regards,
Eyup
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
J
Top achievements
Rank 1
answered on 30 Oct 2013, 12:58 PM
That's perfect, Eyup. Thanks for the help :) You guys have great forum support!
Tags
Filter
Asked by
J
Top achievements
Rank 1
Answers by
J
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or