TTMSFNCSpreadGrid: InplaceEditor and CellSelectionCount

Hi,

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;

Thanks and Regards

Michael

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?!

font size is taken from the cell font settings

Ok, but where is the cell font setting for inplaceeditor. I have all fontsizes on 14 but inplaceeditor is still 12?!

procedure TForm79.TMSFNCSpreadGrid1GetCellProperties(Sender: TObject; ACol,
  ARow: Integer; Cell: TTMSFNCGridCell);
begin
  Cell.Layout.Font.Size := 14;
end;