Hello,
I am attempting to link a combobox to a enum class type, which is should be a relatively simple process from All I've read online, but I keep running into a rather tough problem. When I load the datagridview, and click on the drop-down arrow, I get a "must be using STA single thread apartment" stuff. This is a simple, single-threaded application, and this issue shouldnever jump into the picture. Here is the pertinent code to bind the combobox to the enum:
colptr =
dynamic_cast<DataGridViewComboBoxColumn ^>(dvSteps->Columns["dvStepType"]);
colptr->DataSource = Enum::GetValues( StepType::typeid );
colptr->ValueType = StepType::typeid;
colptr->DataPropertyName = "TypeProperty";
This column links to the enum properly (which is shown below):
enum class StepType
{
UNASSIGNED = 0,
PEAK = 1,
POWER = 2,
RMS = 3,
CREST = 4,
KURTOSIS = 5
};
I have done a lot of research, and cannot find a viable solution. The only thing I've came close on, is that the display types for the combobox has not been set. I am unaware of how exactly to do this.
Any assistance would be greatly appreciated.