FMXGrid and Cell Alignment & Comments

I have problems with FMXGrid Cell Aligment.

The following seems to work just fine:
   grd.Columns[2].HorzAlignment := TTextAlign.Center;
  grd.Columns[3].HorzAlignment := TTextAlign.Center;

But if I add a Comment or Object, the aligment for that cell is changed to Leading
  grd.Objects[2,2] := TObject(1);
  grd.Comments[3,3] := 'This is a comment test';

Furthermore the Comment isn't displayed properly.
It's too small and the text doesn't fit (not autosized).

Thanks for any help or suggestions...


When setting a comment, you are defined cell specific properties that ignore the column setting. the setting is then retrieved via the values set with TMSFMXGrid1.HorzAlignments[3,3] := TTextAlign.Center; or you could override the OnGetCellLayout and set the horizontal alignment there. We were able to reproduce the issue with the comment popup and have applied a fix for this. The next version will address this.

Hi Pieter,

Thanks for the quick response.
Although I can't see why setting an Object or Comment for a cell would change the alignment (It's just data, not display related),
the work-around with TMSFMXGrid1.HorzAlignments[3,3] := TTextAlign.Center works just fine.

Regarding the fix for displaying the comment, I hope it's really "autosizing" and will also work for multiple long lines.

We have tested the autosizing fix and the line you wanted to display displayed as one line after the fix.

If you want multiple lines you need to split them with #13#10