Hallo,
I`m trying to use the CExtGridWnd Class to show a Grid with 2 Columns, 1 Header- and 1 Datarow. So I put a Custom Control with the Grid Class Code On my Form. My Code:
Header:
CExtGridWnd m_puisgrid_couriers;
DataExchange:
void CSelectCourier::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_PUISGRID_COURIERS, m_puisgrid_couriers);
}
Initialisation:
void CSelectCourier::InitControls() {
//*** Steuerelemente initialisieren ***
//* Courier Grid *
//Grid
m_puisgrid_couriers.OuterRowCountTopSet( 1L, false );
//Data Provider
CExtGridDataProvider & m_puisgrid_data = m_puisgrid_couriers.OnGridQueryDataProvider();
m_puisgrid_data.RowInsert(0,2);
m_puisgrid_data.ColumnInsert(0,2);
CExtGridCellHeader* celltop1 = (CExtGridCellHeader*)m_puisgrid_data.CellGet(
0,
0,
RUNTIME_CLASS(CExtGridCellHeader)
);
CExtGridCellHeader* celltop2 = (CExtGridCellHeader*)m_puisgrid_data.CellGet(
1,
0,
RUNTIME_CLASS(CExtGridCellHeader)
);
CExtGridCellRadioButton* cell1 = (CExtGridCellRadioButton*)m_puisgrid_data.CellGet(
0,
1,
RUNTIME_CLASS(CExtGridCellRadioButton)
);
CExtGridCellString* cell2 = (CExtGridCellString*)m_puisgrid_data.CellGet(
1,
1,
RUNTIME_CLASS(CExtGridCellString)
);
celltop1->TextSet("Header1");
celltop2->TextSet("Header2");
cell1->SetCheck(1);
cell2->TextSet("12345");
}
But the result is:

What am I do wrong?