<< Return to Main Index

< Return to Class Index

CGXDBEGrid   Class Members

Initialization

InitFromEngine Function which initializes the default grid appearance. Called from the OnGridInitialUpdate method.

Attributes

GetDBEParam Returns a pointer to the associated CGXDBEParam object.
GetMaxColWidth Returns the maximum column width in number of characters for text fields.

Operations

SetMaxColWidth Specify the maximum column width in number of characters for text fields to be displayed in the cells. The method loops through all columns and resizes them if necessary.
Requery Called to requery the data source. It delegates to the engine's Requery.

Current Record

CancelRecord Cancels any pending changes in the current record and resets the edit- or append-mode. If an addNew was pending, the last row is removed from the grid.
UndoRecord Cancels all changes for the current record (by calling CancelRecord) and empties the undo and redo list.

Default Layout Manager based APIs

These APIs are based on the assumption that one database record corresponds to one row in the grid which is the default layout set by the CGXBrowserLayoutManager. If a custom layout manager is used that, say, wraps a database record between multiple rows then the meaning of the following APIs may change or APIs might become irrelevant.

Attributes

GetAppendRow Returns the row number for the append row. GX_INVALID if undetermined.
GetFieldFromCol Returns the zero-based field index associated with a column. Headers will return a negative value.
GetFirstRow Returns the row number for the first record.
GetLastRow Returns the row number for the last record. If the grid allows appending records it will return the row number for the append row.
GetRecordFromRow Returns the zero-based row index associated with a row. Headers will return a negative value.
IsOnFirstRecord Returns nonzero if the current record is the first record.
IsOnLastRecord Returns nonzero if the current record is the last row (when CanUpdate returns TRUE, the last row is the append row).

Overridables

DeleteRecords Called to delete selected records. The user can select records either by clicking on the row header or programmatically by choosing the SelectRange command.
DeleteRows Called to delete rows from the grid. You need not select a range of rows before calling this method, because you can directly specify the range of rows to be deleted.
GetColIndex GetColIndex returns the original column id for a given column. This original column id can be different from the given column when the column has been moved or the grid has been sorted. The return value is one-based.
GetRowIndex GetRowIndex returns the original row id for a given row. This original row id can be different from the given row when the row has been moved or the grid has been sorted. The return value is one-based.
OnGetRecordCount This method is called to determine the number of records if the last record has been accessed. If the record count is unknown, the method should return LONG_MAX.
OnLoadCellStyle Called to load the value from the data source or apply additional formatting at runtime. This method provides a better abstraction for loading data from data sources at record level. OnLoadCellStyle is called from GetStyleRowCol when needed.

CGXDBEGrid 

Class Overview