Columns Collection |
A Columns collection contains a collection of Column objects in the DataGrid control. App.ActiveForm.DataGridControl.Columns(x) Client support UseWhen 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 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). To add or remove columns from an inserted data grid control, use the Add and Remove buttons in the columns collection editor or use the InsertColumn, InsertColumnArray and DeleteColumn DataGrid methods at Run-time. TIP:It is not possible to remove columns that have been generated underlying IBM i subfiles. In order to hide these columns turn the visible property to False. Referencing individual members of the collectionYou can reference an individual item within any Newlook collection by using its Index. All indexes in Newlook are zero-based therefore if you wanted to return the third item in the collection you would use the following syntax: object.collection(2) ![]()
![]()
Applies ToSee AlsoColumn object | ColCounts collection | DataGrid control | ColCount property | ShowColumns Property | ShowColumnHeaders Property |
|||||||
|