TMSFMXGrid Checkboxes alignment/readonly

I cannot get the checkboxes to center in the cells.  Also, how do I make it so the checkboxes cannot be checked by clicking them with the mouse?  I do want to update the state with code though.


procedure TfrmMain.gridMainGetCellLayout(Sender: TObject; ACol, ARow: Integer;
  ALayout: TTMSFMXGridCellLayout; ACellState: TCellState);
begin
  gridMain.BeginUpdate;
  if ARow = 0 then ALayout.TextAlign := TTextAlign.taCenter
  else begin
    if ACol = 0 then ALayout.TextAlign := TTextAlign.taCenter;
  end;
  gridMain.EndUpdate;
end;

Thanks,
Brent

Hi,


With this code you can make checkboxes centered and insensitive for mouse clicks.

procedure TForm881.TMSFMXGrid1GetCellProperties(Sender: TObject; ACol,
  ARow: Integer; Cell: TFmxObject);
begin
  if Cell is TTMSFMXCheckGridCell then
  begin
    (Cell as TTMSFMXCheckGridCell).CheckBox.Align := TAlignLayout.alCenter;
    (Cell as TTMSFMXCheckGridCell).CheckBox.HitTest := False;
  end;
end;

Kind Regards, 
Pieter