NormalizeDataSource - cCJGridDataSource
Sent to datasource by the grid as part of the virtual mode synchronization process
Type: Function
Return Data Type: Integer
Parameters
| Parameter | Type | Description |
|---|---|---|
| iTopRow | Integer | The current top row index |
Syntax
Function NormalizeDataSource Integer iTopRow Returns Integer
Call Example
Get NormalizeDataSource iTopRow to IntegerVariable
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. As part of this synchronization process the grid sends the message NormalizeDataSource to the datasource.
It is the responsibility of the grid object to perform this synchronization process 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..
NormalizeDataSource should clear whatever internal data is used to determine if a synchronization is needed (i.e., when complete, DataSourceSynchRequired should return False). If caching is supported, this message may be used to remove rows from the cache. If cached rows are removed resulting in the top row offset changing, the offset change must be returned.
You will never send this message and will probably never augment it. If you create a custom datasource class, this interface must be supported.
Return Value
The offset change of the passed top row index.