Remove filter when FilterDelay is set

7 posts, 0 answers
  1. marina
    marina avatar
    4 posts
    Member since:
    May 2011

    Posted 24 May 2011 Link to this post

    Hello,
    I have a gridboundcolumn with attribute FilerDelay set to 1. The filter works correctly, after 1 second the autopostback is done and the filter command is "EqualTo".  The problem is that if I wish to remove the filter by selecting from the filter list the "NoFilter" voice, on ItemCommand method, the argument of the command remains "EqualTo" instead of "NoFilter". So I can't remove the filter set before.  Every other choises(GreaterThen, Less.....etc) apart from "NoFilter" work correctly and are 'recognised' inside the ItemCommand method.
    Could you please help me with this problem?
    Thank you very much.
    Marina
  2. Veli
    Admin
    Veli avatar
    2002 posts

    Posted 27 May 2011 Link to this post

    Hi marina,

    When you have set FilterDelay and AutoPostBackOnFilter="true", clearing the filter is done by deleting the text in the filter textbox. Otherwise, if RadGrid determines the filter textbox contains a value other than empty string, it applies the default filter ("EqualTo" in your case), no matter the filter option you have chosen from the menu. To work around this scenario and have the NoFilter menu option to clear the current applied filter for this column, you can attach to the filter menu OnClientItemClicking event:

    <telerik:RadGrid>
            <FilterMenu OnClientItemClicking="clientItemClicking"></FilterMenu>
    </telerik:RadGrid>

    and use the following javascript:

    function clientItemClicking(sender, args)
    {
        if(args.get_item().get_value() === "NoFilter")
        {
            var target = args.get_targetElement();
            var filterBox = target.parentNode.getElementsByTagName("input")[0];
            filterBox.value = "";
        }
    }

    The above script clears the value of the filter textbox for the column in which the context menu was opened.

    Greetings,
    Veli
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Cristian
    Cristian  avatar
    46 posts
    Member since:
    May 2011

    Posted 10 Aug 2011 Link to this post

    Hi I'm I little bit confused you said that when FilterDelay and AutoPostBackOnFilter="true", are set  clearing the filter is done by deleting the text in the filter textbox, this means that when I erase the text a postback comes like when I write something in the textbox?
    Because I have this situation, if I wtrite some text in the filter textbox the grid is filtered correctly after the filter delay, but if I erase the text I have to hit enter to "erase " the filter, is it possible to do it automatically without hitting enter after clearing textbox?
  5. Veli
    Admin
    Veli avatar
    2002 posts

    Posted 12 Aug 2011 Link to this post

    Hi Cristian José,

    The automatic filtering occurs when the filter input's onchange event fires. The onchange event of an HTML input element fires when the input value is changed and the control loses focus, i.e. is blurred. In your scenario, you need to either press Tab after deleting the text from the input, or click somewhere else with the mouse. Both actions blur the filter input and cause the grid to automatically fire the filter command.

    Greetings,
    Veli
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  6. Martin
    Martin avatar
    4 posts
    Member since:
    Jun 2012

    Posted 20 Apr in reply to Veli Link to this post

    I have the same problem - AutoPostBackOnFilter="true" and now setting the NoFilter is not working anymore (the CurrentFilterValue is autmatically is set)

    I use the ItemCommand event receiver to get the filters that are set.

    How can I set the CurrentFilterValue to NoFilter or make shure that this value is not changed to the default value when NoFilter is clicked?

    ->Version 2015.2.623.35, in SharePoint 2010 and therefore document mode od IE8.<-

  7. Martin
    Martin avatar
    4 posts
    Member since:
    Jun 2012

    Posted 20 Apr in reply to Martin Link to this post

    ...my mistake - it happens when I enable the filter delay function, it work's fine when I enable the autopostback for filtering.
  8. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 25 Apr Link to this post

    Hello Martin,

    I would suggest you to upgrade your application to the latest official release of the controls and see if the issue still appear. Also if the problem still exists i would suggest you to open separate thread,as the current one is rather old and in a new thread it will be easier for us to track the issue in your specific scenario.

    Regards,
    Maria Ilieva
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017