i make this, but it would be nice to make this official:
:
function TrDBGrid.SearchGetFilterString(Fld: TField): string;
var
LikeCh: string;
begin
Result:='';
if not Assigned(Fld) then
Exit;
if Fld is TBooleanField then
// just use cell value
Result:=GetFilterCond(Fld, GetBooleanFieldTextValue(Fld, Fld.AsBoolean), Fld.IsNull, '')
else
if (Fld is TNumericField) or rdbtool.IsDateTimeField(Fld) then
// just use cell value
Result:=GetFilterCond(Fld, Fld.AsString, false, '')
else
if rdbtool.IsApostrField(Fld) then
begin
LikeCh:=FOptionsEx2.FFilters.GetTextFilterLikeChar;
case FOptionsEx2.FFilters.FTextFilterType of
oftAnyPos:
Result:=GetFilterCond(Fld, LikeCh + FSearchText + LikeCh, false, FOptionsEx2.FFilters.GetTextFilterLikeOperator);
oftStartPos:
Result:=GetFilterCond(Fld, FSearchText + LikeCh, false, FOptionsEx2.FFilters.GetTextFilterLikeOperator);
oftExactValue:
;
{ oftAnyPosForNoLikeChar:
if Pos(LikeCh, CondText) = 0 then
CondText:=LikeCh + CondText + LikeCh; }
end;
// Result:=GetFilterCond(Fld, LikeCh + FSearchText + LikeCh, false, FOptionsEx2.FFilters.GetTextFilterLikeOperator);
end;
end;