Problems with IndexFieldNames in firemonkey (FMX)

  

The problem occurs only in firemonkey. With VCL it works perfectly.
I have a dataset (of any type) connected to a grid (of any type)
when clicking on the title of the column this must be ordered by the corresponding field.
For VCL
procedure TForm2.DBGrid1TitleClick(Column: TColumn);
begin
qrySec.IndexFieldNames := Column.FieldName;
end;

For FMX
procedure TManFarmaQry.StringGrid1HeaderClick(Column: TColumn);
begin

case Column.Index of
0:
if mtblMedica.IndexFieldNames = ‘Field1’ then
mtblMedica.IndexFieldNames := ‘Field1’ + ‘:D’
else
mtblMedica.IndexFieldNames := ‘Field1’;

1:
if mtblMedica.IndexFieldNames = ‘Field2’ then
mtblMedica.IndexFieldNames := ‘Field2’ + ‘:D’
else
mtblMedica.IndexFieldNames := ‘Field2’;
2:
if mtblMedica.IndexFieldNames = ‘Field3’ then
mtblMedica.IndexFieldNames := ‘Field3’ + ‘:D’
else
mtblMedica.IndexFieldNames := ‘Field3’;
end;
end;

In the case of FMX, a rearrangement of the registers is observed but it does not correspond to anything. Leaving everything untidy.
I think that since Firedac is used in both cases, the problem is not there. Then there is a synchronization problem in the bind.
Delphi 10.3.3

Comments are closed.