How do I clear the built in filters?

5 posts, 1 answers
  1. Matt
    Matt avatar
    23 posts
    Member since:
    Mar 2011

    Posted 14 Nov 2011 Link to this post

    Using a RadGrid in C#. I have a reset button (since there is no built in one). I can't figure out how to clear the filters though. I have tried a number of things but can't figure it out.
  2. Answer
    Alexander
    Admin
    Alexander avatar
    306 posts

    Posted 17 Nov 2011 Link to this post

    Hello Matt,

    You can clear the FilterDescriptors collection of RadGridView:
    this.radGridView1.FilterDescriptors.Clear();

    I hope it helps.

    Best regards,
    Alexander
    the Telerik team

    Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

  3. Deasun
    Deasun avatar
    22 posts
    Member since:
    May 2019

    Posted 01 Jul Link to this post

    I just noticed that after doing this;

    this.radGridView1.FilterDescriptors.Clear();

    if the focus is still in the filter value box it does not seem to clear that value out.

    Even though the grid rows itself does seem to return the full non filter rows.

     

  4. Dimitar
    Admin
    Dimitar avatar
    2818 posts

    Posted 02 Jul Link to this post

    Hello Deasun,

    You need to make sure that the grid is not in edit mode when this is done:
    if (radGridView1.IsInEditMode)
    {
        radGridView1.EndEdit();
    }
     
    radGridView1.FilterDescriptors.Clear();

    I hope this helps. Should you have any other questions, do not hesitate to ask.
     
    Regards,
    Dimitar
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  5. Deasun
    Deasun avatar
    22 posts
    Member since:
    May 2019

    Posted 02 Jul in reply to Dimitar Link to this post

    Thanks.
Back to Top