Making a DataGridView table that is full of ComboBox's... possible? (Y/N)
Here's my vision:
Around 30 ComboBox's (let's say 6 rows and 5 columns) and they are all in a DataGridView, so I can use some of the features of the datagridview.
I saw (accidentally) how it's possible to have checkboxes in a DataGridView, so I'm pretty certain it's possible to put a ComboBox in there (unless I'm totally wrong), but I'm not sure how.
Whoever can answer this is a l33t h8x0r extreme. thanks!
Re: Making a DataGridView table that is full of ComboBox's... possible? (Y/N)
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.