I managed to incorporate Combo Boxes in a MFC Grid Control (as written by Chris Maunder) (v2.25).
Here's the relevant code I used:
Code:
#include "GridCtrl_src/GridCtrl.h"
#include "NewCellTypes/GridCellCombo.h"
....
CGridCtrl m_Grid;
....
DDX_GridControl(pDX, IDC_GRID, m_Grid);
....
CStringArray options;
options.Add(_T("----"));
options.Add(_T("Option 1"));
options.Add(_T("Option 2"));
options.Add(_T("Option 3"));
options.Add(_T("Option 4"));
m_Grid.SetCellType(j,i, RUNTIME_CLASS(CGridCellCombo));
CGridCellCombo *pCell = (CGridCellCombo*) m_Grid.GetCell(j,i);
pCell->SetOptions(options);
pCell->SetStyle(CBS_DROPDOWN); //CBS_DROPDOWN, CBS_DROPDOWNLIST, CBS_SIMPLE
I hope this helps you somehow.
Bookmarks