Skip to main content
Table of Contents

TTMSFNCDataGridRenderer.AutoSizeColumns Method

Auto-sizes every column, including the fixed columns, to fit its content.

API unit family: TMSFNCDataGridRenderer Declaring type: TTMSFNCDataGridRenderer

Syntax

FMX.TMSFNCDataGridRenderer.hppPascalC++
procedure AutoSizeColumns(const AMode: TTMSFNCDataGridAutoSizeMode = gamAllCells; const APadding: Integer = 5);
void __fastcall AutoSizeColumns(const TTMSFNCDataGridAutoSizeMode AMode = (TTMSFNCDataGridAutoSizeMode)(0x1), const int APadding = 0x5);

Remarks

Measured text sizes are cached for the duration of the call. When merged cells are involved, the columns are swept repeatedly (up to a fixed number of passes) until the widths stop changing. The grid repaints once at the end.

Parameters

Name Description
AMode Cells measured: gamAllCells (default) or gamVisibleCells.
APadding Extra pixels added to each measured content width. Default 5.