Hi,
You can use the following code to center the grid:
totsize := 0;
for I := 0 to TMSFMXGrid1.ColumnCount - 1 do
begin
totsize := totsize + TMSFMXGrid1.ColumnWidths;
if totsize + TMSFMXGrid1.ColumnWidths > Printer.PageWidth then
break;
end;
TMSFMXGrid1.Options.Printing.PrintMargins.Left := (Printer.PageWidth - totsize) / 2;
Kind Regards,
Pieter