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

# TGridColumn.Width

The display width in pixels for the column on its Grid control.

## Declaration

Source position: grids.pas line 625

`published property TGridColumn.Width : Integer read GetWidth write SetWidth stored IsWidthStored;`

## Description

Width is an Integer property with the display width for the column in pixels. Its value is used when the column has its Visible property set to True. Otherwise, the property value is 0.

Width can be assigned at design-time using the object inspector in the IDE, or at run-time in program code.

If a value has not been assigned for the property, the DefaultColWidth property from the Grid control is used as the property value.

Width is updated at run-time when the column is resized on the Grid control. This can occur when the border on the fixed header is dragged (when column resizing is enabled in the Options for Grid control). It may also occur when AutoFillColumns is enabled for Grid control.

Use MinSize and MaxSize to specify the smallest and largest widths for the column when SizePriority has a non-zero value.

## See also

TGridColumn.MaxSize |  | The maximum size for the column in pixels.
TGridColumn.MinSize |  | The minimum size for the column in pixels.
TGridColumn.SizePriority |  | The auto-sizing priority for the column.
TGridColumn.Visible |  | True if the column is visible (not hidden) on the Grid control.
TCustomGrid.AutoFillColumns |  | Indicates whether columns are automatically resized to fill the visible area in the grid.
TCustomGrid.Columns |  | Definitions for the columns displayed the grid.
TCustomGrid.DefaultColWidth |  | Default width used for grid columns.
TCustomGrid.Options |  | Contains the set of optional features and/or behaviors enabled for the grid control.