Grid Control
Description
The Grid control is used to display and allow editing of data in a spreadsheet format.
Usage
The Grid control has cells that contain data in rows and columns. The operator can select rows and cells. The operator can optionally edit the cells in the specified columns.
At design time you can configure the Grid control:
- Click the GridEditor property to open the designer of the grid control.
- Design the grid by setting properties to the desired values.
- Close the designer.
At runtime:
- You can read and write cell text using the CellText property.
- You can add or remove rows using AddRow and RemoveRow properties.
- You can change a cell forecolor and backcolor using the CellForeColor and CellBackColor properties.
Grid Control Properties
Property | Description |
---|---|
AddRow | Adds a row at runtime. |
BorderStyle | The background color for the control. Default: Control |
CellBackColor | Sets or gets the back color of a cell at runtime. |
CellForeColor | Sets or gets the fore color of a cell at runtime. |
CellText | Sets or gets the text in the cell at runtime. |
Enabled | Sets whether the control is enabled at runtime. Default:True |
EventTaskType | Sets the type of task used for events. Default: Normal |
GridEditor | Opens the designer to setup the Grid control. |
Height | The height of the control in pixels. |
Left | The left coordinate of the control in pixels. |
Name | The name of the control. Default: GridXX |
RemoveRow | Removes a row at runtime. |
RowCount | Sets or gets the number of rows at runtime. |
ScrollBars | Sets how to display the scrollbars for the control. Default: None |
SelectedIndex | Sets or gets the selected row at runtime.(Only available from SPEL+ programs) |
Top | The top coordinate of the control in pixels. |
Visible | Sets whether the control is visible or not at runtime. Default:True |
Width | The width of the control in pixels. |
Grid Control Events
Event | Description |
---|---|
CellChanged | Executes when the user leaves a cell that was changed. |
Click | Executes when the user clicks the control with the mouse. |
DblClick | Executes when the user double clicks the control with the mouse. |
GridEditor
The grid editor is a dialog where the user can modify and set up the grid control. It is only available at design time.
It has many properties to set in order to best suit the user’s needs. To get more information on the Grid Editor, refer to the Grid Editor property.