CGXBrowserGrid Class Members
Construction
CGXBrowserGrid | Constructs a browser grid object. |
Initialization
InitBrowserSettings | Overridable which initializes the default grid appearance. You should call this method from your OnInitialUpdate method. |
Attributes
GetAppendRow | Returns the row number for the append row. GX_INVALID if undetermined. |
GetBrowseParam | Returns a pointer to the associated CGXBrowseParam object. |
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. |
GetMaxColWidth | Returns the maximum column width in number of characters for text fields. |
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). |
IsRecordDirty | Returns nonzero if the current record has been changed, but changes are not yet written to data source. |
SetCanAppend | Specify if you want the user to be able to append rows to the recordset. |
Operations
SetBinaryFlags | |
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. |
Current Record
AddNew | Prepares the grid for adding a new record. The grid appends a new line in the grid. Call Update to complete the addition. |
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. |
Edit | Prepares for changes to the current record. Call Update to complete the edit. |
UndoRecord | Cancels all changes for the current record (by calling CancelRecord) and empties the undo and redo list. |
Update | Completes an AddNew or Edit operation by saving the changed values to the data source. |
Overridables
CanAppend | Called to determine if the user should be able to append rows to the data source. |
CanUpdate | Called to determine if the user should be able to change data in the data source. |
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 columnn 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. |
MoveTo | Called to position the recordset to the given row. You should return FALSE if the positioning failed. |
OnAddedNewRecord | Called from Update when a new record has been added to the data source. |
OnFlushBlobValue | |
OnFlushCellValue | OnFlushCellValue is called from within CGXBrowserGrid::OnFlushRecord for all values changed in the current record buffer. You should override this method to store changed values in your data source. If you cannot write the passed value to the data source, you may throw an exception and specify the text to be displayed in the grid with SetWarningText. |
OnFlushRecord | This method writes dirty fields back to the data source and prepares the data source at record level before changes are written to it with OnFlushCellValue. |
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. |
Requery | Called to requery the data source. The default implementation resets the high-water mark for the last seen record. |