custom filter control

I tried the Essential Grid Filter Combo. I must not understand the syntax for 'Like' as I couldn't get it to work.

I tried entering a 'Match' for 'B' and got Berlin and Brandenburg.

I tried 'Like' for 'B' and/or 'b' and got nothing returned.

Am I missing something in the syntax.


3 Replies

RS Rajarajeswari S Syncfusion Team August 29, 2008 04:32 AM UTC

Hi Richard,

Thanks for using Syncfusion products.

The “Like” operator is used for creating Expressions.

Description for the “Like” operator:

It checks for the field, that starts exactly as specified in the right-hand argument. For example, “ [Name] like 'Bruch' “ returns 1 for the particular records whose “Name” field value is exactly ‘Bruch’. We can use an asterisk as a wildcard character.

For example,

“ [Name] like 'Br*' - returns 1 for the records whose “Name” field starts with ‘Br’.
“ [Name] like '*br' - returns 1 for the records whose “Name” field ends with ‘br’.

Please refer the below code snippet with ‘Like’ operator:

GridExpressionFieldDescriptor efd = new GridExpressionFieldDescriptor();
efd.Expression = " [Name]like 'Br*'";
efd.Name = "Exp Field";
// Adding Expression fields to the collection
this.GridGroupingControl1.TableDescriptor.ExpressionFields.Add(efd);


Please refer the sample from the below link, which illustrates this:

http://www.syncfusion.com/support/user/uploads/Expression_cad64795.zip


Please let us know, if this helps you out.

Regards,
Raji




RS Richard Slauenwhite August 29, 2008 07:28 PM UTC

I tried it against this sample. Am I missing something?


http://www2.syncfusion.com/infrastructure/web/grid.grouping.web/samples/2.0/Filtering/ComboBoxTextCell/CS/FilterBarDemo.aspx

>Hi Richard,

Thanks for using Syncfusion products.

The “Like” operator is used for creating Expressions.

Description for the “Like” operator:

It checks for the field, that starts exactly as specified in the right-hand argument. For example, “ [Name] like 'Bruch' “ returns 1 for the particular records whose “Name” field value is exactly ‘Bruch’. We can use an asterisk as a wildcard character.

For example,

“ [Name] like 'Br*' - returns 1 for the records whose “Name” field starts with ‘Br’.
“ [Name] like '*br' - returns 1 for the records whose “Name” field ends with ‘br’.

Please refer the below code snippet with ‘Like’ operator:

GridExpressionFieldDescriptor efd = new GridExpressionFieldDescriptor();
efd.Expression = " [Name]like 'Br*'";
efd.Name = "Exp Field";
// Adding Expression fields to the collection
this.GridGroupingControl1.TableDescriptor.ExpressionFields.Add(efd);


Please refer the sample from the below link, which illustrates this:

http://www.syncfusion.com/support/user/uploads/Expression_cad64795.zip


Please let us know, if this helps you out.

Regards,
Raji






RS Rajarajeswari S Syncfusion Team September 5, 2008 06:01 AM UTC


Hi Richard,

Sorry for the delay in getting back to you.

Please refer the video clip from the below link, which illustrates the, use of ‘Like’ operator with FilterBarTextCell:

http://www.syncfusion.com/support/user/uploads/like_490fc696.zip

Please have a look at the above, and let me know if this helps you out.

Regards,
Raji



Loader.
Up arrow icon