class Grid
A grid of other controls.
Syntax
[<oRef> =] new Grid(<container> [,<name expC>])
<oRef>
A variable or property—typically of <container>—in which to store a reference to the newly created Grid object.
<container>
The container—typically a Form object—to which you’re binding the Grid object.
<name expC>
An optional name for the Grid object. If not specified, the Grid class will auto-generate a name for the object.
Properties
The following tables list the properties, events, and methods of interest in the Grid class.
Property |
Default |
Description |
true |
Whether navigating down past the last row automatically calls beginAppend( ) | |
true |
Whether columns may be moved with the mouse | |
true |
Whether columns may be sized with the mouse | |
false |
Whether dragged objects (normally a table or table field) can be dropped in the Grid | |
true |
Whether editing is allowed or the grid is read-only | |
true |
Whether rows may be sized with the mouse | |
true |
Whether columnCheckBox control is painted with a checkbox for all checkbox cells in the Grid. | |
0 – None |
How the Grid object is anchored in its container (0=None, 1=Bottom, 2=Top, 3=Left, 4=Right, 5=Center, 6=Container) | |
GRID |
Identifies the object as an instance of the Grid class | |
gray |
Sets the background color for data displayed in grid cells, as well as the empty area to the right of the last column and below the last grid row. | |
|
The height of each cell | |
(GRID) |
Identifies the object as an instance of a custom class. When no custom class exists, defaults to baseClassName | |
silver |
Sets the color of the grid lines between the data columns | |
WindowText/Window |
Sets the text color and background color for data displayed in a grid cell that has focus. Can be overridden by setting the colorHighlight property of a GridColumn's editorControl to a non-null value. | |
WindowText/Window |
Sets the text color and background color for data displayed in grid cells that do not have focus. Can be overridden by setting the colorNormal property of a GridColumn's editorControl to a non-null value. | |
WindowText/BtnFace |
Sets the color of the indicator arrow, or plus sign, and the row header background. | |
siilver |
Sets the color of the grid lines between the data rows | |
HighlightText/HighLight |
Sets the text color and background color for a row of data selected when the rowSelect property and/or the multiSelect property is true | |
|
The number of columns in the grid | |
|
An array of objects for each column in the grid | |
false |
Whether pressing Tab follow CUA behavior and moves to next control, or moves to next cell | |
|
The number of the column that has focus in the grid | |
|
The Rowset object that is linked to the grid | |
300 |
The delay time, in milliseconds, between each column scroll when dragging columns | |
1 |
Sets the column to be displayed in the left-most unlocked column position. | |
|
The name of the column inside which the cursor is confined. | |
1 |
Width of grid lines in pixels (0=no grid lines) | |
true |
Whether column headings are displayed | |
true |
Whether column (vertical) grid lines are displayed | |
true |
Whether the indicator column is displayed | |
true |
Whether row (horizontal) grid lines are displayed | |
true |
Whether the relative row count is displayed as the grid is scrolled vertically | |
WindowText/BtnFace |
Sets the text color and background color for grid column heading controls | |
true |
Whether the current heading font style is Bold | |
false |
Whether the current heading font style is Italic | |
Operating system or PLUS.ini file setting |
Sets the font used to display data in a grid's headingControls | |
10 pts. |
Sets the character size of the font used to display data in a grid's headingControls | |
false |
Whether to display the current heading font with a horizontal strikeout line through the middle of each character | |
false |
Whether the current heading font style is Underline | |
Auto |
When a horizontal scrollbar appears (0=Off, 1=On, 2=Auto, 3=Disabled) | |
false |
Whether a partial row at the bottom of the grid is displayed | |
0 |
The number of columns that remain locked on the left side of the grid as it is scrolled horizontally. | |
false |
Whether multiple rows may be visually selected | |
false |
Whether the entire row is visually selected | |
Auto |
When a vertical scrollbar appears (0=Off, 1=On, 2=Auto, 3=Disabled)
| |
Event |
Parameters |
Description |
<left expN> |
When the mouse enters the Grid display area during a Drag&Drop operation | |
|
When the mouse leaves the Grid display area without having dropped an object | |
<left expN> |
While the mouse drags an object over the Grid display area during a Drag&Drop operation | |
<left expN> |
When the mouse button is released over the Grid display area during a Drag&Drop operation | |
|
After the form containing the grid is resized | |
|
After moving to another row or column in the grid
| |
Method |
Parameters |
Description |
|
Returns a bookmark for the row currently displayed in the first row of the grid. | |
<expN> |
Returns a reference to the GridColumn object for a designated column | |
|
Returns a two dimensional array for current column information | |
|
Returns a bookmark for the row currently displayed in the last row of the grid. | |
|
Repaints the grid | |
|
|
Returns an array of bookmarks for the currently selected rows in the grid
|
The following table lists the common properties, events, and methods of the Grid class:
Description
The Grid object is a multi-column grid control for displaying the contents of a rowset. The dataLink property is set to the rowset. Columns are automatically created for each field in the rowset.
Each column is represented by a GridColumn object. If the default columns are used, these objects are hidden, and all fields are displayed. By explicitly creating a GridColumn object for each column as an element in the grid’s columns array, you may control the fields that are displayed and assign different kinds of controls in different columns.
Navigation in the rowset updates any grids that are dataLinked to the rowset, and vice
versa. When you explicitly create GridColumn objects, you may set their
dataLink properties to fields
in other rowsets, like the fields in a linked detail table.
Grid level mouse event handlers will fire anywhere ona grid as long as
the event handler is defined and is not overridden by a matching columnHeading
or editorControl event. this includes mouse events on a column header,
row header, grid cell, or grid background.
If you wish to have the Grid level events fire along with the editorControl or columnHeading control event, you can call the grid level event from within the editorControl or columnHeading control event handler.
While in Desgin Mode, if columns are defined, you can:
size columns, move columns, and set the grid's cellHeight (rowHeight) by using the mouse
select a column's editorControl or headingControl into the inspector by left clicking them with the mouse.