Default filter problem

3 posts, 1 answers
  1. itWorks itWorks
    itWorks itWorks avatar
    6 posts
    Member since:
    Feb 2009

    Posted 11 Feb 2009 Link to this post

    Hello experts!

    I have a GridView, with a column that is filtered like this:

    protected override void OnLoad(EventArgs e)
    {
         base.OnLoad(e);
         ..............
         gridview1.DataSource = data;
        
         string fString = "filter";
         FilterExpression filter = new FilterExpression(FilterExpression.BinaryOperation.AND, GridKnownFunction.Contains, fString.ToString());
         gridview1.Columns["filtered_column"].Filter = filter;
         ...............
    }

    It works fine, but when I try to set the No Filter option to that column, it does nothing. It's supposed to show all the rows, but it still shows the filtered ones.

    How I can solve this?

    Thanks for your help!
  2. Answer
    Nick
    Admin
    Nick avatar
    767 posts

    Posted 13 Feb 2009 Link to this post

    Hello itWorks itWorks,

    Thank you for your question. Please change your code in the following way.

    ... 
    FilterExpression filter = new FilterExpression(FilterExpression.BinaryOperation.AND, GridKnownFunction.Contains, GridFilterCellElement.ParameterName); 
    filter.Parameters.Add(GridFilterCellElement.ParameterName, fString.ToString()); 
    ... 

    We will update our documentation to reflect this code. Do not hesitate to write me back if you have further questions.

    Kind regards,
    Nick
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. itWorks itWorks
    itWorks itWorks avatar
    6 posts
    Member since:
    Feb 2009

    Posted 16 Feb 2009 Link to this post

    Thanks!
    It works!
Back to Top