how can I modify CellEditor, I tried the following with no effect:
procedure TForm2.gdGetCellEditorProperties(Sender: TObject; ACol, ARow: Integer; CellEditor: TTMSFNCGridEditor);
var
c: TTMSFNCGridEdit;
begin
if (CellEditor is TTMSFNCGridEdit) then
begin
c := (CellEditor as TTMSFNCGridEdit);
c.Precision := 2;
c.Font.Size := 18;
c.TextSettings.FontColor := TAcr.Blue;
c.TextSettings.Font.Size := 18;
end;
end;
Also, when selecting multiple cells CellSelectionCount is always 0?!
grid.Options.Selection.Mode := smCellRange;
for i := 0 to gd.CellSelectionCount - 1 do
begin
c := gd.SelectedCell[i];
end;
TTMSFNCGridEdit is actually a normal TEdit as base class, so setting properties can be done in the same way as with a normal TEdit, you need to alter the StyledSettings for changes to TextSettings to have effect.
CellSelectionCount is mapped on distinct cells, if you are not using distinct selection you need to use TMSFNCGrid1.Selection instead which has start & end cell range selection.
Thanks, TMSFNCGrid1.Selection is what I was looking for.
With InplaceEditor I now have:
if (CellEditor is TTMSFNCGridEdit) then
begin
c := (CellEditor as TTMSFNCGridEdit);
c.StyledSettings := c.StyledSettings - [TStyledSetting.Size, TStyledSetting.FontColor];
c.FontColor := Tacr.Dimgray;
c.Font.Size := 14;
c.TextSettings.Font.Size := 14;
end;
FontColor is ok now, but FontSize still doesn't change?!