Problem
Problems with calling
() from
().
Cause
Action
Do not call SetCurrentCell() from within OnAddedNewRecord(). Update() and is called from SetCurrentCell(). (See the call stack in OnAddedNewRecord()). Therefore any calls to SetCurrentCell() have no effect because after OnAddedNewRecord() returns the calling SetCurrentCell() method will continue its job and reposition the current cell.
To work around this behavior override SetCurrentCell() as follows:
// reset bool attribute m_bAddedANewRecord = FALSE; // call base class version (maybe also call LockUpdate(TRUE)) // check bool attribute |
||
SetCurrentCell... | ||
// reset attribute m_bAddedANewRecord = FALSE; |
in your OnAddedNewRecord() method set the m_bAddedNewRecord attribute (and don't call SetCurrentCell()).
m_bAddedNewRecord = TRUE |