BindDataSource - cCJGrid
Updates binding information from the grid to the grid datasource
Type: Procedure
Syntax
Procedure BindDataSource
Call Example
Send BindDataSource
Description
BindDataSource is used to move grid definition data from the grid object to the datasource object. This is called when a grid is initialized (activated) and it can be called anytime you have changed grid set up information that the datasource object needs to know about.
The actual data definitions that need to be passed from the grid object to its datasource object is dependent on the needs of these two classes and the interface contract established between these two objects. The cCJGrid class does nothing with this method, as there are no special data definitions that need to be moved to the cCJGridDataSource object. The cDbCJGrid class uses this to provide the cDbCJGridDataSource object with information about the Data Dictionary Server, the Index Ordering and direction, plus other settings.
Normally, these bindings are static so will never need to send this message. The exception to this rule is the cDbCJGrid's Ordering property, which may change. If you change the Ordering of an active cDbCJGrid, that ordering will take effect until BindDataSource is called. While you could call this, the suggested approach is to call one of two cDbCJGrid methods, ReorderGridByColumn and ChangeOrdering, which are specifically designed for this.
If you create a custom datasource object, you may need to create a custom BindDataSource method to initialize your datasource. This is considered an advanced programming technique. If you need to do this, you should study how BindDataSource is defined in the cDbCJGrid class.