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

4 posts, 1 answers
  1. J
    J avatar
    30 posts
    Member since:
    Oct 2012

    Posted 22 Oct 2013 Link to this post

    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.
  2. J
    J avatar
    30 posts
    Member since:
    Oct 2012

    Posted 22 Oct 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 25 Oct 2013 Link to this post

    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.
  5. J
    J avatar
    30 posts
    Member since:
    Oct 2012

    Posted 30 Oct 2013 Link to this post

    That's perfect, Eyup. Thanks for the help :) You guys have great forum support!
Back to Top