TTMSFMXGrid change FontColor on cell value

Is it possible to change font color on condition of one of the cells?

I have a dataset, with an active value, when not active I would like the font to be gray or red.
When active then the color should not change.

What I meant, in the event onGetCellLayout, you can manipulate with ALayout.FontFill.Color, but when I do, the fields goes blank in the grid, besides I have a feeling, that Color is the background Color?
Anyways - how do I change the Font color?

we have tested this here and could change the font color:

procedure TForm1.FormCreate(Sender: TObject);

procedure TForm1.TMSFMXGrid1GetCellLayout(Sender: TObject; ACol, ARow: Integer;
  ALayout: TTMSFMXGridCellLayout; ACellState: TCellState);
  ALayout.FontFill.Color := TAlphaColorRec.Red;

Thanks - works here also :+1:

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.