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

Filtering expression with '%'

2 Answers 47 Views
Grid
This is a migrated thread and some comments may be shown as answers.
romulo~
Top achievements
Rank 1
romulo~ asked on 24 Nov 2015, 11:25 AM

Greetings,

 I was trying to use the Contains filter with a value containing a '%' char in hte middle of value but no success. The settings are:

  • EnableLinqExpressions="False"
  • The columns are generated programatically

What I'm trying to filter is something like:

([description] like '%apple%juice%') to bring values like "green apple juice" or "apple juice box" or even "yadda apple whatever juice" (sorry for the bad example)

 

The filter expression when I enter "apple%juice" in the filter item is generated like that example but the filter doesn't work. Is this approach possible or simply can't be done?

2 Answers, 1 is accepted

Sort by
0
Accepted
Eyup
Telerik team
answered on 26 Nov 2015, 12:16 PM
Hello Romulo,

To achieve double-value filtering, you can use the Between function to search for two values. This is achieved by placing a blank space between the words. For example:
1. Go to:
http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/filtering/basic-filtering/defaultcs.aspx
2. Focus the filter input of the ShipCountry column of the first grid.
3. Type Brazil France.
4. Filter by Between function.
5. You can verify the result.


For multi-value, filtering you can examine the CheckBoxList filtering in the second grid from the demo link above. You can also check the new Excel-Like filtering:
http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/filtering/excel-like-filtering/defaultcs.aspx

Hope this helps.

Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
romulo~
Top achievements
Rank 1
answered on 22 Dec 2015, 07:32 PM
Based on these examples I could find a way around my needs. Thanks!
Tags
Grid
Asked by
romulo~
Top achievements
Rank 1
Answers by
Eyup
Telerik team
romulo~
Top achievements
Rank 1
Share this question
or