Skip to content

peIconAlignment - cCJGridColumn

Specifies the alignment for icons, images or checkbox displayed in the column

Type: Property
Access: Read/Write
Data Type: XTPColumnAlignment
Parameters: None

Syntax

Property XTPColumnAlignment peIconAlignment
Access Type Syntax
Read Access: Get peIconAlignment to XTPColumnAlignmentVariable
Write Access: Set peIconAlignment to XTPColumnAlignmentVariable/Value

Description

Valid values are:

Constant Meaning
xtpAlignmentIconLeft Left aligns the icon of cells in the ReportColumn (default)
xtpAlignmentIconCenter Centers the icon of cells in the ReportColumn
xtpAlignmentIconRight Right aligns the icon of cells in the ReportColumn
xtpAlignmentIconTop Aligns icons on the top of cells in the Report Column
xtpAlignmentIconVCenter Vertically centers the icon of cells in the ReportColumn
xtpAlignmentIconBottom Aligns icons on the bottom of cells in the Report Column

Each left, right and center alignment constant can be combined with one of the top, vertical center and bottom constants. For example:

Set peIconAlignment to (xtpAlignmentIconLeft + xtpAlignmentIconTop)

This would set the icon or checkbox alignment to the top-left.

Set peIconAlignment to explicitly position checkboxes displayed in a column. By default, checkboxes are displayed in the center of each cell. To display checkboxes in the column set the pbCheckbox property.

If the grid's pbUseColumnTextAlignment is set to True, then setting peIconAlignment also affects the default alignment of icons displayed in the column header. To align header icons differently from the column cell icons, set the peHeaderAlignment property accordingly.

Detecting Changes in Source Layout

When source code changes are made in a grid, the restored layout may interfere with those changes. When this happens, changes made to the grid and its columns will not appear because the old settings are being restored. The grid class attempts to recognize when such a change has occurred by checking if the number of columns has changed. If it has, the previous setting will not be restored. This only catches a small number of the possible changes and it is quite likely that it will not recognize that a change has actually occurred. When this occurs, it will appear that the grid is ignoring your source code changes. The number of columns that appear may be wrong, the ordering and size of the columns may be wrong and some of the grid alignment settings will be wrong.

If this happens, you must tell the system that the menu layout has changed. You can do this by changing (i.e., incrementing) the build number of the grid system by setting the piLayoutBuild property.

During development, it is probably best to disable the loading and saving of the grid's environment. Set pbRestoreLayout of the grid object to False to turn off restore layout for a grid, or set pbPreserveEnvironment of the cApplication object to False to disable restore layout for your entire application.