This step modifies OnInitDialog to subclass the user control on the dialog template and to perform some basic grid initialization.
Open DlgGridDlg.cpp.
Add the following line after #include "stdafx.h":
#include "MyGridWnd.h" |
Search for OnInitDialog.
Replace the // TODO: line with the following code:
// Please refer to the MFC documentation on // SubclassDlgItem for information on this // call. This makes sure that our C++ grid // window class subclasses the window that // is created with the User Control. m_wndGrid.SubclassDlgItem(IDC_GRID, this); // Initialize the grid. For CWnd based grids // this call is essential. For view based // grids this initialization is done in // OnInitialUpdate. m_wndGrid.Initialize(); // Sample setup for the grid m_wndGrid.GetParam()->EnableUndo(FALSE); m_wndGrid.SetRowCount(100); m_wndGrid.SetColCount(20); m_wndGrid.SetStyleRange(CGXRange(1,1), CGXStyle() .SetValue("Hello") ); m_wndGrid.SetStyleRange(CGXRange(1,2), CGXStyle() .SetValue("World!") ); m_wndGrid.GetParam()->EnableUndo(TRUE); |
Save and close DlgGridDlg.cpp.
Copyright © Rogue Wave Software, Inc. All Rights Reserved.
The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.