Skip to content

DataSourceSynchRequired - cCJGridDataSource

Determines if the grid needs to be synchronized with the datasource

Type: Function
Return Data Type: Boolean

Syntax

Function DataSourceSynchRequired Returns Boolean

Call Example

Get DataSourceSynchRequired to BooleanVariable

Description

The grid classes use the Codejock ReportControl's virtual mode for managing data. The data is not stored in the grid, it is stored in the datasource object. When the grid needs to display a page of data, it gets the data it needs from the datasource. The use of virtual mode requires that the grid be notified anytime there is a change in the number of rows. This can occur when rows are added or deleted. It can also occur in cacheable grids (cDbCJGrid / cDbCJGridDataSource) when data is loaded or unloaded from the cache. When this happens, an internal grid synchronization process must occur. The synchronization task sends the message NormalizeDataSource to the datasource as part of its process. It is the responsibility of the grid object to perform this as needed. It is the responsibility of the datasource object to provide the DataSourceSynchRequired interface to let the grid know if such a synchronization is required. It is also the responsibility of the datasource object to provide the NormalizeDataSource message, which lets the datasource object know that the synchronization has occurred.

You will never send this message and you would only augment it if you were creating your own datasource class. Even then, you are not likely to use it.

Return Value

True if datasource has changed in a way (rows added, row deleted, cache changes) that requires internal grid synchronization.