Skip to content

AutoSize Property

See Also

GridColumn Object | Width Property | Resizable Property

See Also


Description

Specifies if column auto sizing is on or off.

Property Type

Read-write property

Syntax (Visual Basic)

Public Property AutoSize() As Boolean

Remarks

If TRUE, the width of the column is automatically resized when the GridControl's client area is resized by the user. If FALSE, the column keeps its initial size that was specified when the column was created.

NOTE: When a column is added, the Resizable parameter is used to set the value for BOTH the Resizable and AutoSize properties. If these properties will have different values, then you will have to change the required value after the column has been added. For example, if you specified that Resizable=TRUE when the column was added, but you require that AutoSize=FALSE, then you need to add code to change this.

Example

Enable Column Autosize (Visual Basic)

This sample illustrates how to allow a column to be automatically sized.

' Add this to the General code section
Const COLUMN_NAME = 1

' This code is placed in the Form_Load event
Dim Column As GridColumn

' The Resizable parameter sets the value for BOTH the Autosize and Resizable properties
' Here, we want Resizable off and AutoSize on
Set Column = wndGridControl.Columns.Add(COLUMN_NAME, "Name", 300, False)

' Enable Autosize
Column.AutoSize = True

' Or you can access the column this way
wndGridControl.Columns(COLUMN_NAME).AutoSize = True

See Also

GridColumn Object | Width Property | Resizable Property


Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.