TTMSFNCCustomDataGrid.AutoSizeColumn Method
Resizes a column to the width that fits its cell content.
API unit family: TMSFNCDataGrid
Declaring type: TTMSFNCCustomDataGrid
Syntax
procedure AutoSizeColumn(AColumn: Integer; const AMode: TTMSFNCDataGridAutoSizeMode = gamAllCells; const APadding: Integer = 5);
void __fastcall AutoSizeColumn(int AColumn, const TTMSFNCDataGridAutoSizeMode AMode = (TTMSFNCDataGridAutoSizeMode)(0x1), const int APadding = 0x5);
Remarks
Call it after the data is loaded; measurement runs inside a single update. OnColumnSized is not fired.
Parameters
| Name | Description |
|---|---|
AColumn |
Zero-based column index to resize. |
AMode |
Cells measured: gamAllCells (default) measures every cell of the column; the other mode measures only the cells currently on screen, which is faster for large grids. |
APadding |
Extra pixels added to the measured content width. Default 5. |