Grid.AutoSizeColumn

Grid.AutoSizeColumn (

string ObjectName,

number Column,

number ResizeMode = GVS_DEFAULT,

boolean ResetScroll = true,

boolean Redraw = true )

Description

Automatically sizes a single column in a grid object.

Parameters

ObjectName

(string) The name of the grid object.

Column

(number) The column (0-based) to autosize.

ResizeMode

(number) The auto resize mode. Choose from:

CONSTANT

VALUE

DESCRIPTION

GVS_DEFAULT

0

Use the default behavior which is to make the column as small as it can be while still accommodating all of its text. (Default)

GVS_HEADER

1

Make the column resize according to the size of the text in the header cell.

GVS_DATA

2

Make the column resize to the widest non-header cell in the column.

GVS_BOTH

3

Mixes both GVS_HEADER and GVS_DATA using whichever is the widest in the column.

ResetScroll

(boolean) Whether the scrollbars should be reset. This is an optional argument. Choose from:

VALUE

DESCRIPTION

true

Reset the scrollbars. (Default)

false

Don't reset the scrollbars..

Redraw

(boolean) Whether the grid should be automatically redrawn after the operation. Usually you will want to set this to true. However there may be times when you want to perform a lot of grid actions and delay the redraw until later. This is an optional argument. If omitted it will default to true.

VALUE

DESCRIPTION

true

Automatically redraw the grid after the operation. (Default)

false

Delay the redraw until later.

Returns

Nothing. You can use Application.GetLastError to determine whether this action failed, and why.

See also: Related Actions