phoDataSource - cCJGrid
Contains the handle to the grid's datasource object
Type: Property
Access: Read/Write
Data Type: Handle
Parameters: None
Syntax
Property Handle phoDataSource
| Access Type | Syntax |
|---|---|
| Read Access: | Get phoDataSource to HandleVariable |
| Write Access: | Set phoDataSource to HandleVariable/Value |
Description
Every grid has a datasource object that is used to store the grid's data and provide data services to the grid. The phoDataSource property contains a handle to this object. You will never directly set this property, but you will use this to access methods within the datasource object.
Ideally, the grid object knows nothing about the data it is displaying. It uses the column objects (cCJGridColumn and cDbCJGridColumn) to define the data (data-type, mask, etc.) and it uses the datasource object (cCJGridDataSource and cDbCJGridDataSource) to load, manage and store the data.
A grid is assigned a datasource object when the object is created. The grid's constructor calls the CreateDataSource function. This creates the datasource object, which the constructor will then assign to phoDataSource. Normally, a cCJGrid will use a cCJGridDataSource object and a cDbCJGrid will use a cDbCJGridDataSource object.
Sample
Handle hoDataSource
Integer iSel
Get phoDataSource to hoDataSource
Get SelectedRow of hoDataSource to iSel
Sample
Handle hoDataSource
Boolean bNew bChanged
Get phoDataSource to hoDataSource
Get IsSelectedRowNew of hoDataSource to bNew
Get IsSelectedRowChanged of hoDataSource to bChanged
Sample
Handle hoDataSource
tDataSourceRow[] MyData
Get phoDataSource to hoDataSource
Get DataSource of hoDataSource to MyData
See Also
cCJGridDataSource | cDbCJGridDataSource | CreateDataSource | tDataSourceRow