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

Default filter in ver Q1 2008

4 Answers 106 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Pedro Valero Matas
Top achievements
Rank 1
Pedro Valero Matas asked on 22 Apr 2008, 06:18 AM
With the Q3 2007 this lines works

        For Each column As Telerik.WinControls.UI.GridViewDataColumn In RadGridView.MasterGridViewTemplate.Columns
            column.Filter.Function = Telerik.WinControls.UI.GridKnownFunction.Contains
        Next

but with the latest version i obtain the error
Error    1    'Function' no es un miembro de 'Telerik.WinControls.Data.FilterExpression'.
(Function is not a member of Telerik.WinControls.Data.FilterExpression)

Sorry for my english, i'm spanish.

4 Answers, 1 is accepted

Sort by
0
Pedro Valero Matas
Top achievements
Rank 1
answered on 22 Apr 2008, 07:43 AM
Ok. The response for Jose works for me :-)
0
Accepted
Dwight
Telerik team
answered on 22 Apr 2008, 08:29 AM
Hello Pedro,

Thanks for writing.

The RadGridView filtering has been extended to allow multiple filtering conditions on a single field (column). That is why the filter function is not property of the FilterExpression itself, but of the filter predicates, that are contained in the filter expression.

Please, use the following code snippet to achieve the same functionality:
For Each column As Telerik.WinControls.UI.GridViewDataColumn In RadGridView.MasterGridViewTemplate.Columns 
    column.Filter.Function = New FilterExpression(FilterExpression.BinaryOperation.AND, GridKnownFunction.StartsWith, GridFilterCellElement.ParameterName) 
Next 

All the best,
Evtim
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Judy
Top achievements
Rank 1
answered on 15 May 2008, 09:09 PM
I've just upgraded to Q1 2008 SP1 (pre-release 6.0.2.0).  The code you specify in this thread as a replacement for existing code to change the default filter does not work for me.  It returns two errors:

"Function is not a member of Telerik.Wincontrols.Data.Filter"

AND

"Type FilterExpression is not defined"'

What am I doing wrong?
0
Jordan
Telerik team
answered on 17 May 2008, 03:46 PM
Hi Judy,

As Evtim explained, the Function property is no longer a member of the FilterExpression class, but a member of the FilterPredicate objects within FilterExpression. We have done this change to allow for more complex filters to be applied on the data.

However, it seems that something has happened with Evtim's code example. So here is some of the code that is used in our QSF's filtering example:
 
FilterExpression filter = new FilterExpression(FilterExpression.BinaryOperation.AND, 
                GridKnownFunction.StartsWith, GridFilterCellElement.ParameterName); 
 
this.radGridView1.Columns["City"].Filter = filter; 

As you can see, the newly created FilterExpression is assigned directly to the Filter property of the column (and not to the Filter.Function as there is no such property any more). You can find more information on grid's Q1 2008 breaking changes in this document:
http://www.telerik.com/products/WinForms/Breaking_Changes_RadGridView_Q1_2008.pdf

I hope that helps.
 

Kind regards,
Jordan
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
Pedro Valero Matas
Top achievements
Rank 1
Answers by
Pedro Valero Matas
Top achievements
Rank 1
Dwight
Telerik team
Judy
Top achievements
Rank 1
Jordan
Telerik team
Share this question
or