Objective Grid: Embedding a grid in a CFormView

Article ID: 527
Last updated: 16 Apr, 2018
Article ID: 527
Last updated: 16 Apr, 2018
Revision: 3
Views: 1961
Posted: 09 Jan, 2001
by Meltreger B.
Updated: 16 Apr, 2018
by Meltreger B.

Problem


How can I embed a grid in a form view?


Cause



Action


There is a sample gridsvw.cpp/.h (CSampleFormView) in gridapp.

The key point is that you have to override the OnInitialUpdate( ) for the CSampleFormView class and subclass the grid control as explained in the section "Using a grid in a dialog":

void CSampleFormView::OnInitialUpdate( )
{
CFormView::OnInitialUpdate( );
m_wndGrid.SubclassDlgItem(IDC_USER1, this);
m_wndGrid.Initialize( );
m_wndGrid.SetFocus( );
}

This article was:   Helpful | Not helpful
Report an issue
Article ID: 527
Last updated: 16 Apr, 2018
Revision: 3
Views: 1961
Posted: 09 Jan, 2001 by Meltreger B.
Updated: 16 Apr, 2018 by Meltreger B.

Others in this category