SelectRow - cCJGridDataSource
Sets the SelectedRow for a datasource
Type: Procedure
Parameters
| Parameter | Type | Description |
|---|---|---|
| iRow | Integer | The row index to set as the SelectedRow; -1 if none |
| bUpdateExternalData | Boolean | If True, the external data, such as a DataDictionary server, should be notified of this selection |
Syntax
Procedure SelectRow Integer iRow Boolean bUpdateExternalData
Call Example
Send SelectRow iRow bUpdateExternalData
Description
The SelectedRow method determines which row in the datasource is currently selected. This is the row that is the current focus row of the grid. It is crucial that the SelectedRow in the datasource object match the grid's focus row. The SelectedRow is also used to synchronize activity between a DataDictionary object and the datasource.
When a row is selected, it sends the SelectRow message to the datasource object. You should never send this message. The cCJGrid class carefully maintains SelectedRow and sends SelectRow as needed, which ensures that the grid, the datasource, and external data (e.g., DataDictionary objects and file buffers) are all synchronized.
The bUpdateExternalData parameter is only used by data aware grids (cDbCJGrid). When True, a message is sent to the grid's DataDictionary object instructing it to load the data and update both the grid and datasource with the latest database record data. The use of this flag has to be carefully maintained to avoid recursion. If the row is being selected in response to a DataDictionary find, it should be False, because the DataDictionary already knows about the record. If the grid is selecting a row as part of a navigation event, this should be True, so that the DataDictionary's current record is loaded.
You will never send this message and will probably never augment it. If you create a custom datasource class, this interface must be supported.