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

Complex filtering

1 Answer 89 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Charles Guthrie
Top achievements
Rank 1
Charles Guthrie asked on 24 Apr 2009, 05:12 PM
The code below results in 'contains "high" and contains "high"' instead of 'contains "high" and contains "prod"'.  I can't figure out what I'm doing wrong.  Can anyone help?

filterExpression 

 

filter = new FilterExpression();

 

 

filter.Predicates.Add(

FilterExpression.BinaryOperation.AND, GridKnownFunction.Contains, GridFilterCellElement.ParameterName);

 

 

filter.Parameters.Add(

GridFilterCellElement.ParameterName, "high");

 

 

filter.Predicates.Add(

FilterExpression.BinaryOperation.AND, GridKnownFunction.Contains, GridFilterCellElement.ParameterName);

 

 

filter.Parameters.Add(

GridFilterCellElement.ParameterName, "prod");

 

 

 

this.radGridView.Columns["Description"].Filter = filter;

 

 

 

 

 

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 27 Apr 2009, 09:18 AM
Hi Charles,

You should add the second parameter as a ParameterName2 in this case. Here is the modified code:

FilterExpression filter = new FilterExpression(); 
 
filter.Predicates.Add(FilterExpression.BinaryOperation.AND, GridKnownFunction.Contains, GridFilterCellElement.ParameterName); 
filter.Parameters.Add(GridFilterCellElement.ParameterName, "high"); 
 
filter.Predicates.Add(FilterExpression.BinaryOperation.AND, GridKnownFunction.Contains, GridFilterCellElement.ParameterName2); 
filter.Parameters.Add(GridFilterCellElement.ParameterName2, "prod"); 
 
this.radGridView1.Columns["Name"].Filter = filter;  
 

If you need further assistance, please write me back.

Best wishes,
Jack
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.
Tags
GridView
Asked by
Charles Guthrie
Top achievements
Rank 1
Answers by
Jack
Telerik team
Share this question
or