Page 1 of 1

CRDBGrid, FilterBar and customization

Posted: Mon 26 Sep 2011 08:36
by leonell
Hi,

I have crdbgrid with "string" type columns and FilterBar.

It is filtering exactly what is entered ( column "equals" value).
For example if "John" is entered, then "John" is found, but "John Silver" or "Frank John" are not found.
This is of course correct from some point of view.

Does exist some chance customize it?

Something as:
TCRDBGrid.AfterFilterRequest(col: TCRColumn; var filter: string);
??

Thank you.
Leonell

Posted: Mon 26 Sep 2011 14:44
by AlexP
Hello,

To adjust the filter so that search is performed by the inclusion of symbols into the string rather than by an exact match, you need to use the special character (%).
For example,
%John% will search for all the strings containing John.

Posted: Tue 27 Sep 2011 04:27
by leonell
Hello Alex,
thanks, it is working fine.

Plash from Devart team in 2007 wrotes:
>The TCRDBGrid component doesn't support any expressions in the filter bar. It supports only single values.

Will be nice to change this.

Any my tip is:
add dqeAdvFilterLogic (true/false) property to TCRDBGrid.
When is set then after entering value call AfterAdvancedFiltering() with column and entered value as string. And programmer is responsible to set FilterSQL (or call some CRDB method) correctly.

And where it will help after parsing?

14.2.2012:15.2.2012 ... value between "14.2.2012" and "15.2.2012"
New York|Chicago|Texas ... value in ("New York","Chicago","Texas")
= ... is not null
!New York .. value "New York"
etc

Leonell

Posted: Tue 27 Sep 2011 08:37
by AlexP
Hello,

The TCRDBGrid component is no longer being developed.
Its source code is supplied with SDAC, so you can change it any way you want.