Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Objective Grid User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

21.4 Database Engine Grid

The database engine grid (CGXDBEGrid) holds a reference to the CGXDBEngine and the CGXBrowserLayoutManager. It delegates all of its operations to the layout manager, which communicates with the DBEngine.

The CGXDBEGrid class also exposes a set of APIs that you can use directly on the datasource to query or modify it. See the CGXDBEGrid class members in the Objective Grid Class Reference. These APIs are based on the assumption that one database record corresponds to one row in the grid. This is the default layout set by the CGXBrowserLayoutManager. If you use a custom layout manager that wraps a database record between multiple rows, the meaning of the following functions may change or functions might become irrelevant. A better approach is to operate on the CGXDBEngine associated with the grid when you need to get/set data programmatically.

21.4.1 Hierarchical Database Engine Grid

The CGXHierDBEGrid derives from CGXDBEGrid and CGXRegularGrid in the following manner:

It holds a reference to the CGXHierGridLayoutManager and CGXDBEngine. Like CGXDBEGrid, this delegates all of its operations to the CGXHierGridLayoutManager, which initializes the grid.

21.4.2 Initializing the Grid with CGXDBEngine

You need to bind the database engine classes together. Consider the following initialization code:

This code binds the grid to a DBEngine through the SetEngine() call. It also creates a new instance of the layout manager in the grid. Now you can make the layout manager's initialization function pointer point to the data access specific initialization function. The grid is bound to the DBEngine.



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.