ComponentOne True DataControl 8.0 > Using True DataControl Lite > Binding Data-Aware Controls to a TDataLite Control |
You can bind controls to TDataLite directly:
Example Title |
Copy Code
|
---|---|
Set TDataLite1.DataSource = Adodc1 Set Grid1.DataSource = TDataLite1 |
For ComponentOne controls, such as True DBGrid 8.0, it means that TDataLite is used as its fully functional data source.
For controls other than TDBGrid, in standard mode (TDataLite.DataMode = 0 – DataSource, TDataLite.QueryMode= False, TDataLite.Pivot= False), the real data source will not be the TDataLite control, but the standard data source behind it, TDataLite1.DataSource.
For controls other than TDBGrid in one of the above modes, TDataLite will be their real data source, just as for ComponentOne controls. This exception allows you to use the special TDataLite features, memory-stored data, query mode, pivot (OLAP) support, with data-aware controls of your choice.
Use direct binding in the following cases:
Using ComponentOne True DBGrid 8.0, bind it directly to TDataLite control, to have complete access to all TDataLite features.
Using data-aware controls other than TDBGrid, bind them directly to TDataLite if you use one of the special TDataLite modes: memory array mode, query mode or pivot mode (see Binding data-aware controls and TDataLite to the same standard data source). Since QueryMode can be changed at run time, use direct binding at all times if you intend to enable query mode.
Even with direct binding, the same restriction from Binding data-aware controls and TDataLite to the same standard data source still applies: you can only use server-side cursors (CursorLocation = adUseServer) with True DBGrid 8.0; you must not bind other controls to TDataLite bound to a server-side cursor data source. Problems in server-side cursor implementation will not allow TDataLite to work properly unless it takes full responsibility as a data source, which can be only with True DBGrid 8.0.