A DataGrid column object represents an individual column in the Columns collection of the DataGrid control.
Newlook Smartclient
Newlook Server
When a subfile is received from the IBM i, the recognition engine attempts to organize its data into columns. These columns are represented by the columns collection.
If columns are clearly identified in the subfile, then the ShowColumns property defaults to True and column separators are displayed in the GUI. When the recognition engine encounters ambiguities in column recognition, then the ShowColumns property defaults to False, columns are not displayed and the Columns Editor is disabled in Designer. Column information is still stored in the Columns collection however and it is possible to force the data into columns by setting the ShowColumns property to True, either in Designer, or via a script or macro. When column recognition is forced on, the recognition engine inserts blank cells, where necessary, in order to organize the data into logical columns and maintain grid headings.
When a data grid control has columns enabled, there may be a difference between the total number of identified columns, which can be returned by the App.ActiveForm.grid.Columns.Count
property, and the total number of columns displayed in the GUI. This is because the recognition engine hides certain columns that it identifies as non-data or 'padding' columns. By default, these columns have their Visible property set to False.
For this reason it is important to use the Columns.Count property to determine the total number of columns in a subfile before creating any code that references specific columns or contains looping structures. (Refer to the ColCounts collection topic for information on looping through cells in non-column grids).
The following column properties are available for grids that have ShowColumns enabled. They can be set via the Columns Editor in Designer or dynamically at runtime via a script or macro. For more information about modifying column properties refer to the Columns property topic.
Newlook Smartclient |
Newlook Server |
Deprecated
|
Obsolete
Property |
Client |
Description |
|
Gets or sets a value that determines the alignment of text in a column. |
|
|
Gets or sets whether the grid can be sorted by this column in GUI view. |
|
|
Returns the specified cell. |
|
|
Gets or sets the available choices for this column. |
|
|
Gets or sets the alternate background color of data cells within this object. |
|
|
Gets or sets the alternate foreground color of data cells within this object. |
|
|
Gets or sets the background color of data cells within the column. |
|
|
Gets or sets the name of a field in a data source to displayed in this column. Read-only at run-time. |
|
|
Gets or sets the foreground color of data cells within the column. |
|
|
Gets or sets the host date format for the column. |
|
|
Gets or sets the enabled set of cells within the column. |
|
|
Gets or sets the background color of a entry-capable data cells within the column. |
|
|
Gets or sets the foreground color of entry-capable data cells within the column. |
|
|
Gets or sets the data type format which determines which characters are allowed for user input. |
|
|
Gets or sets whether data cells that have the same value on successive rows are displayed in a vertically merged cell. |
|
|
Gets or sets the background color of the column header. |
|
|
Gets or sets the foreground color of the column header. |
|
|
Gets or sets an image index within an ImageList control. |
|
|
Returns the current index of the column. |
|
|
Gets or sets the default input length of cells within the column. |
|
|
Gets or sets a list of allowed values for the cells in the column. |
|
|
Gets or sets the name of the column. |
|
|
Determines whether hidden field data will be loaded. |
|
|
Gets or sets the referenced field name for fields associated with an external host file. Open Display Files-only. |
|
|
Gets or sets the sort type for the column of a datagrid control. Smartclient-only property. |
|
|
Gets or sets user defined information for the column. |
|
|
Gets or sets the column header text. |
|
|
Gets or sets the control type for the datagrid column or cell. |
|
|
Gets or sets whether column colors override colors specified for the grid. |
|
|
Gets or sets whether the column is visible or hidden. |
|
|
Gets or sets the width of the object in pixels at default size, which is the object's size at design-time. |
ColumnHeaders object | Cell object | DataGrid control