<< Return to Main Index

< Return to Class Index

CGXODBCGrid Class Members

Construction

CGXODBCGrid Constructs an ODBC grid browser object.

Attributes

GetDbParam Returns a pointer to the associated CGXDbParam object.
SetRecordset Lets you attach the CRecordset object to be displayed in the grid.

Fields

GetColSize Returns the default text length for the specified column.
GetFieldData Retrieves field data from the current record. The data will be returned as CString.
SetFieldData Changes field data in the current record. You should pass the data as CString.

Overridables

ConvertValueToString Called to retrieve a string with the value for the ODBC field bound to the specified column. The string will be displayed in the grid.
GetDisplaySize This method is called from OnInitColInfo to determine the default column width in characters for the specified field type. You may override this method if you want to change the initial widths for specific data types.
OpenRecordset Opens the recordset (only if not yet opened), initializes the columns (width, field name, length, base style) and redraws the grid.
OnGetRecordset Returns a pointer to the attached CRecordset object.
OnInitColInfo Called from OpenRecordset to determine the default settings for columns based on their data types. The method associates the columns with a base style, determines the column title and width.
PreUpdateRecordset This overridable is called from OnFlushRecord after all changed values have been flushed to the CRecordset and just before the CRecordset::Update method is called. You may override it if you want to do any changes in the current record of the CRecordset before it is updated to the database.

Foreign Tables

AttachForeignTable Lets you attach a table with a foreign key to a column. For example, you could attach a foreign table to the column and display a descriptive text for a key (e.g., student name instead of student id)

CGXODBCGrid

Class Overview