In a TTMSFMXGrid, how to programmatically change the align of Numeric Fields to Right.
thanks!
Pieter
(Pieter)
2
You can achieve this with the following code:
procedure TForm1.TMSFMXGrid1GetCellEditorProperties(Sender: TObject; ACol,
ARow: Integer; CellEditor: TFmxObject);
begin
if TMSFMXGrid1.Columns[ACol].Editor = etNumericEdit then
(CellEditor as TTMSFMXEdit).TextSettings.HorzAlign := TTextAlign.Trailing
else
(CellEditor as TTMSFMXEdit).TextSettings.HorzAlign := TTextAlign.Leading;
end;
Ok. But now: How to set programmatically the property "Editor" to etNumericEdit to a Column?
I'm doing all the work programmatically, this means that Columns has the default values of a recently dropped component on the form.
In what unit is etNumericEdit?
In this event handler, CellEditor is not in scope.
how to refer to it?
Pieter
(Pieter)
6
You need to use the unit FMX.TMSEdit