[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Grids' (#lcl)

TCustomStringGrid.AutoSizeColumn

Automatically adjusts the width of a column to accommodate the widest text value in the column.

Declaration

Source position: grids.pas line 1802

public procedure TCustomStringGrid.AutoSizeColumn(

  aCol: Integer

);

Arguments

aCol

  

Column number resized in the method.

Description

AutoSizeColumn sets the column width to the length of the widest text found in the column specified by ACol.

AutoAdjustColumn is called to determine the width needed for the specified column number. The measurement includes optional title images and sort indicators for column headers, the text displayed for the cells using the Font or TitleFont for the control, and cell padding. Each row is visited to measure the content displayed in the column.

The calculated width is stored in ColWidths at the position in ACol.

Use AutoSizeColumns to calculated the sizes for all Columns on the grid control.

Include goDblClickAutoSize in the Options property to allow columns to be automatically resized when a mouse double Click occurs on the border in a cell header. In other words, when the resize cursor is visible.

See also

TCustomStringGrid.AutoAdjustColumn

  

Adjusts the column size for the font, text length, and images used in the specified column.

TCustomStringGrid.AutoSizeColumns

  

Resizes all columns to accommodate the longest text value in each column.

TCustomStringGrid.Cells

  

Provides indexed access to a cell value by its column and row number.

TCustomDrawGrid.ColWidths

  

Provides indexed access to the Width for a column in the grid.

TCustomGrid.Columns

  

Definitions for the columns displayed the grid.

TCustomGrid.Options

  

Contains the set of optional features and/or behaviors enabled for the grid control.

TGridColumn

  

Implements a column definition used for tabular data in TCustomGrid.

TGridOptions

  

Set type used to store enabled grid options.

TGridOption

  

Represents grid option values available for grid controls.


Version 3.2 Generated 2024-02-25 Home