How To Fire Filter Event

4 posts, 1 answers
  1. Andy
    Andy avatar
    18 posts
    Member since:
    Apr 2011

    Posted 01 Aug 2011 Link to this post

    I have a RadGrid with Filters.  The user can browse to another page (details page) from the page with the RadGrid.  When the user returns I restore the filters to their state when the user browsed away.  This is done via Session data.

    The search criteria is restored along with the filter values.  The data is read from the datbase and all is well except that the FILTERs were not honored.In other words, all records are displayed that meet the search criteria, but the filters are not applied.

    I think I need to cause a filter event to fire, as if the user had clicked the filter ICON.  How do I cause this to happen?

    Thanks for your help.


  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 01 Aug 2011 Link to this post

    Hello Andy,

    You can achieve this by checking for CommandName in ItemCommand event.
    C#:
    protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
    {
     if (e.CommandName == RadGrid.FilterCommandName)
     {
         //your code here
     }
    }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Trevor
    Trevor avatar
    5 posts
    Member since:
    Aug 2014

    Posted 04 Oct 2014 in reply to Princy Link to this post

    Yo uhave not answered his queston.,

    he doesnt want to detect the event.

    He want to @cause@/ fire  the event.

    I also want to have a button, that clears the filters ,THEN redispay the page.on the client..


    I can clear the filters but page remains the same..

    As usual with telerik something so simple seems so hard..


  5. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1800 posts

    Posted 08 Oct 2014 Link to this post

    Hello Trevor,

    For clearing the filters you will need to traverse through each column, set the CurrentFilterValue to an empty string and rebind the grid.

    An example of such implementation could be found for the second RadGrid in the following online demo:
    Additionally, you could examine the following forum thread, where some examples are also available:
    Hope this helps.


    Regards,
    Konstantin Dikov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top