TCustomDBGrid.AutoAdjustColumn procedure
Adjust properties in the specified column to display the longest value.
Declaration
procedure AutoAdjustColumn(aCol: Integer); overrideArguments
aCol | Column (or field) number affected in the method. |
Description
AutoAdjustColumn is an overridden method in
TCustomDBGrid used to adjust column properties to accommodate the
largest value in the specified column. It re-implements the method from the
ancestor class.
AutoAdjustColumn uses the column definition, or the field from the linked dataset, to determine the column or field size needed for the data displayed on the control canvas. A temporary TCanvas instance is created and used to measure the text width for the column. The calculated width is stored in the inherited ColWidths property.
dgDisplayMemoText has been included in
the Options for the grid control.
AutoAdjustColumn is called from the DblClick method when the values goColSizing and goDblClickAutoSize have been included in the Options property.
Use AutoAdjustColumns to resize all automatically-sized columns in the control.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
