peFooterAlignment - cCJGridColumn
Specifies the column footer text alignment
Type: Property
Access: Read/Write
Data Type: XTPColumnAlignment
Parameters: None
Syntax
Property XTPColumnAlignment peFooterAlignment
| Access Type | Syntax |
|---|---|
| Read Access: | Get peFooterAlignment to XTPColumnAlignmentVariable |
| Write Access: | Set peFooterAlignment to XTPColumnAlignmentVariable/Value |
Description
Valid values are:
| Constant | Meaning |
|---|---|
| xtpAlignmentDefault | Align according to the column default (default) |
| xtpAlignmentLeft | Left aligns the text |
| xtpAlignmentCenter | Centers the text |
| xtpAlignmentRight | Right aligns the text |
| xtpAlignmentVCenter | Vertically centers the text |
| xtpAlignmentWordBreak | This allows the text to "wrap" if the width of the column is not wide enough to display the text. This specifies that line breaks are allowed. |
By default, footer text is aligned the same as the column's rows of text. This is controlled by the column's peTextAlignment property. If the grid's pbUseColumnTextAlignment property is set to True and peFooterAlignment is set to xtpAlignmentDefault, then it will be the value of the column's peTextAlignment property which determines the footer text's alignment. If pbUseColumnTextAlignment is False, then the footer text will be left aligned.
If peFooterAlignment is not set to xtpAlignmentDefault, then this value will determine the footer alignment regardless of pbUseColumnTextAlignment or peTextAlignment.
Vertical Alignment and Multi-Row Footers
Each of the Left, Center or Right alignment constants can be combined with the WordBreak and VCenter alignment constants. For example:
Set peFooterAlignment to (xtpAlignmentCenter + xtpAlignmentVCenter + xtpAlignmentWordBreak)
The WordBreak constant allows the footer text to wrap to multiple rows thus increasing the overall height of the grid footer. Wrapped text is always left aligned, the right or center alignment constants only apply when the column is wide enough to display all the footer text on one line. The VCenter constant ensures that a single line footer text is vertically centered in the case where the grid footer spans multiple lines.
To assign text to a column's footer, set the psFooterText property.
In order to display a footer section, the grid object's pbShowFooter property must be set True.
| Col 1 | Col 2 |
|---|---|
| Note: | Images/icons cannot be displayed in the column footer. |
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.