Skip to main content
Table of Contents

TTMSFNCDataGrid.AutoSizeGrid Method

Resizes every column and every row to fit their content in a single update.

API unit family: TMSFNCDataGrid Declaring type: TTMSFNCDataGrid Inherited from: TTMSFNCCustomDataGrid

Syntax

FMX.TMSFNCDataGrid.hppPascalC++
procedure AutoSizeGrid(const AMode: TTMSFNCDataGridAutoSizeMode = gamAllCells; const APaddingColumn: Integer = 5; const APaddingRow: Integer = 5);
void __fastcall AutoSizeGrid(const TTMSFNCDataGridAutoSizeMode AMode = (TTMSFNCDataGridAutoSizeMode)(0x1), const int APaddingColumn = 0x5, const int APaddingRow = 0x5);

Remarks

Columns are sized before rows, and the sweep is repeated while sizes still change, so wrapped text and merged cells settle on consistent sizes. Prefer this over separate AutoSizeColumns and AutoSizeRows calls.

Parameters

Name Description
AMode Cells measured: gamAllCells (default) or only the cells currently on screen.
APaddingColumn Extra pixels added to each measured column width. Default 5.
APaddingRow Extra pixels added to each measured row height. Default 5.