This is a migrated thread and some comments may be shown as answers.

Default filter problem

2 Answers 102 Views
GridView
This is a migrated thread and some comments may be shown as answers.
itWorks itWorks
Top achievements
Rank 1
itWorks itWorks asked on 11 Feb 2009, 05:59 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Nick
Telerik team
answered on 13 Feb 2009, 06:31 PM
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.
0
itWorks itWorks
Top achievements
Rank 1
answered on 16 Feb 2009, 10:15 PM
Thanks!
It works!
Tags
GridView
Asked by
itWorks itWorks
Top achievements
Rank 1
Answers by
Nick
Telerik team
itWorks itWorks
Top achievements
Rank 1
Share this question
or