Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to customize the default Find Panel filtering algorithm

$
0
0

Find Panel uses an extended syntax that allows you to specify complex criteria. You can find detailed information here:
- Find Panel

However, sometimes it is necessary to exclude/include some rows in the resulting list according to your custom logic. In this case, you can filter rows manually by handling View.CustomRowFilter Event. This example demonstrates how to construct your own filter criteria and use ExpressionEvaluator to check whether a row should be hidden.

For demo purposes, this example just shows how to find exact matches of a typed string. The same result can be accomplished with the default behavior if you enclose your text in double quotes in Find Panel. To provide your own logic, just modify the MyConvertFindPanelTextToCriteriaOperator method as your needs dictate.

Question Comments

Added By: Sigol at: 9/6/2012 2:34:45 PM    

In the text above "if you enclose your text in commas in Find Panel" I think should read "if you enclose your text in DOUBLE QUOTES in Find Panel".

Added By: Arnaud Chevallier at: 12/21/2012 5:35:48 AM    

This may be usefull, as for example replacing parenthesis by double quotes. However with this method the results are not highligted anymore. Is there any workaround ?

Added By: Mu XU at: 7/17/2013 8:19:11 AM    

can't resolve DxFtsContainsHelperAlt in dx 11

Added By: Catalin Zainescu at: 12/21/2015 4:07:00 PM    

The suggested workaround feels more like black magic... For example, can you guarantee that "ColumnView.GetFindToColumnsCollection" method will always be there?

Do you have any plans to add an option to change this default filtering behavior? At the very least, it would be really nice to be able to switch from "OR" to "AND" filtering logic instead of having to add "+" to every token.

Added By: Nikita (DevExpress Support) at: 12/22/2015 6:41:18 AM    

Hello Catalin,

I understand that this example a quite complex. And while we really cannot guarantee that we won't change the GetFindToColumnsCollection method, we do guarantee that we will keep this example in the working state. So, if we change some grid code, which will break this example, we will upload a new version of this example to the site. 
I also understand that such functionality is useful, so we are going to consider introducing similar functionality in the future. 

Added By: rouzzi anissa at: 8/16/2016 2:42:33 AM    i want to customise my search in the find panel( i want to switch from "OR" to "AND" filtering logic) but i didn't understand this example?Could you please attach an  example with grid view .Thx a lotAdded By: Svetlana (DevExpress Support) at: 8/16/2016 3:03:30 AM    

Hello,

I've created a separate ticket on your behalf (T415372: How to customize search in Find Panel). It has been placed in our processing queue and will be answered shortly.


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>