I've found that the filtering of the grid fails when special characters are used.
This is caused by using the MatchStrEx (FMX.TMSGridDataUtil) function internally.
The special characters ( ) ; ^| are causing this behaviour.
In my example below the Ampersand (&) is the "problem".
I would expect that clicking button 1 would result in a single result, but there are NONE.
Drop a TTMSFMXGrid and 2 TButton's on a form and use the following code:
procedure TForm1.FormCreate(Sender: TObject);
begin
TMSFMXGrid1.Options.ColumnSize.Stretch := True;
TMSFMXGrid1.Options.ColumnSize.StretchAll := True;
TMSFMXGrid1.FixedColumns := 0;
TMSFMXGrid1.ColumnCount := 2;
TMSFMXGrid1.RowCount := 5;
TMSFMXGrid1.Cells[0, 0] := 'Department';
TMSFMXGrid1.Cells[0, 1] := 'Finance 1';
TMSFMXGrid1.Cells[0, 2] := 'Finance 2';
TMSFMXGrid1.Cells[0, 3] := 'Research & Development';
TMSFMXGrid1.Cells[0, 4] := 'Finance 3';
end;
procedure TForm1.Button1Click(Sender: TObject);
var
flt: TFilterData;
begin
TMSFMXGrid1.RemoveFilters;
flt := TMSFMXGrid1.Filter.Add;
flt.Column := 0;
flt.Condition := 'Research & Development';
flt.CaseSensitive := False;
TMSFMXGrid1.ApplyFilter;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
flt: TFilterData;
begin
TMSFMXGrid1.RemoveFilters;
flt := TMSFMXGrid1.Filter.Add;
flt.Column := 0;
flt.Condition := 'Research*';
flt.CaseSensitive := False;
TMSFMXGrid1.ApplyFilter;
end;