Skip to content

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 Example Usage
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 it 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.

Samples

Sample 1

Handle hoDataSource
Integer iSel
Get phoDataSource to hoDataSource
Get SelectedRow of hoDataSource to iSel

Sample 2

Handle hoDataSource
Boolean bNew bChanged
Get phoDataSource to hoDataSource
Get IsSelectedRowNew of hoDataSource to bNew
Get IsSelectedRowChanged of hoDataSource to bChanged

Sample 3

Handle hoDataSource
tDataSourceRow[] MyData
Get phoDataSource to hoDataSource
Get DataSource of hoDataSource to MyData

See Also