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

# TCustomGrid.DoAutoAdjustLayout

Performs actions to automatically apply the layout policy with the specified scaling factors.

## Declaration

Source position: grids.pas line 1041

`protected procedure TCustomGrid.DoAutoAdjustLayout(`
`const AMode: TLayoutAdjustmentPolicy;`
`const AXProportion: Double;`
`const AYProportion: Double`
`); override;`

## Arguments

`AMode` |  | Auto-adjust layout policy applied in the method.
`AXProportion` |  | Horizontal scaling factor for the layout policy.
`AYProportion` |  | Vertical scaling factor for the layout policy.

## Description

DoAutoAdjustLayout is an overridden method in TCustomGrid.

AMode contains the layout policy applied in the method, and contains a value from the TLayoutAdjustmentPolicy enumeration. AXProportion and AYProportion contain the horizontal and vertical scaling factors applied for the specified layout policy.

DoAutoAdjustLayout calls the inherited method on entry to apply the scaling factors for the grid control. This includes scaling its width and/or height using values in Align and/or Anchors. The BaseBounds for the control may also be affected.

When AMode contains lapAutoAdjustWithoutHorizontalScrolling or lapAutoAdjustForDPI, the layout policy is applied to the columns and rows in the control. When Columns has been enabled the factor in AXProportion is applied to MinSize, MaxSize and the stored Width for each of the TGridColumn entries. AXProportion is also applied to the values in Cols and DefaultColWidth.

The value in AYProportion is applied to the values stored in Rows and DefaultRowHeight.

DoAutoAdjustLayout is called from the inherited AutoAdjustLayout method.