CGXGridParam::EnableUndo
void EnableUndo(BOOL bEnable = TRUE);
bEnable
Specifies if undo-creation is enabled (TRUE) or disabled (FALSE).
Remarks
Enables or disables generation of undo information in subsequent commands.
If you do execute commands in OnInitialUpdate, you should first disable undo-creation, execute the necessary commands, and finally enable undo-creation, so that the user cannot undo the initial settings.
Example
This example illustrates how to turn off undo-creation while executing initial commands:
VERIFY(m_GridBox.Create(WS_BORDER|VISIBLE,rect,this,
IDC_GRIDBAR_GRIDBOX));
m_GridBox.Initialize();
// process initial commands
// but they should not be undoable
m_GridBox.GetParam()->EnableUndo(FALSE);
m_GridBox.SetRowCount(20);
m_GridBox.SetColCount(10);
m_GridBox.GetParam()->EnableUndo(TRUE);
// subsequent commands are undoable
See Also
CGXGridParam::IsEnableUndo CGXGridCore::OnGridInitialUpdate