TTMSFNCGrid and Bitmap

Hello.
When Bitmap in inserted in TTMSFNCGrid Cell, with

AddBitmap(ACol, ARow, BitmapName);

cell turn in ReadOnly FALSE state (if clicked outside bitmap image a box for enter text is showed), even if ReadOnly is set to TRUE in Columns properties (Object Inspector).
Furthermore, cell alignement of Bitmap is not settable in OnGetCellLayout event, like in previous FMX component, with
ALayout.TextAlign := TTMSFNCGraphicsTextAlign.gtaCenter;
There is some workaround for this issues?
Thank you.

Hi,

You can set the readonly flag with

TMSFNCGrid1.ReadOnlys[3, 3] := True;

When there are cell settings/properties set such as a bitmap or other properties cell related, they take over. Which means that the column settings are ignored. The read-only flag should apply to all other cells set at column level.

To align the bitmap you can use the OnGetCellProperties

procedure TForm1.TMSFNCGrid1GetCellProperties(Sender: TObject; ACol,
  ARow: Integer; Cell: TTMSFNCGridCell);
begin
  if (Cell is TTMSFNCBitmapGridCell) then
    (Cell as TTMSFNCBitmapGridCell).ControlPosition := gcpRight;
end;
1 Like

Thank you very much.
Works fine!