473,320 Members | 1,845 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

C# \ C++ DataGridViewComboBoxColumn Issues

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.
Sep 24 '07 #1
1 1531
After doing more research, I am almost certain that I need to set the valuemember and display member to something, and I cannot figure out what.

The display member is going to be to a property inside a class named: "TypeEnumProperty", which is not an acceptable input come runtime.
Sep 24 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Shawn | last post by:
I am trying to use a DataGridView to display one column of textboxes with a single value from a query and then next to it have a combobox that displays results from another query. What happens is...
3
by: philip | last post by:
I have a datagridview with some columns. One of them has been declared as a DatagridviewComboboxColumn The datasource of this column is a table of an Access Database. There is 13000 lines in...
3
by: Rain County | last post by:
I am programmatically building and populating a table and then making it the data source for a dataGridView. I want to add a column to the dataGridView which will be a DataGridViewComboBoxColumn. ...
4
by: John | last post by:
Hi, I've been trying to populate a DataGridViewComboBoxColumn with objects. The object is defined as : private struct manufactItem { public string name; public Guid? man_id;
0
by: Simon Tamman | last post by:
How do other people get around having to define the ValueMember in a DataGridViewComboBoxColumn when binding to a list of business objects? I'm currently doing the following, and it feels wrong...
0
by: Ken | last post by:
Hi I have a little application that does datavalidation. It supports dynamically loaded plugins (you drop a dll with a class implementing IValidator<Tin the same dir as the main application)....
1
by: sklett | last post by:
I have a DataGridView bound to a custom business object. The business object has 2 attributes that are FKs to a lookup table (think HairColorID, EyeColorID, etc) For these 2 columns I have...
0
by: ajey | last post by:
hi all! Im doing a windows application (C#), i have a datagridview bound from a Sql database in which i want one column to be ComboBox.I use DataGridViewComboBoxColumn and bind that column value.......
1
by: =?Utf-8?B?RWQgQ29oZW4=?= | last post by:
I have tried to use the DataGridComboBoxColumn object with limited success. What I want to do is to create one new unbound column to be a combo box (so far, this has worked), populate it with items...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.