Reputation: 2746
I've added a DataGridViewComboBoxColumn
to my DataGrid, it shows up but I cannot open the dropdown by clicking on it.
When hovering with the mouse, the box is highlighted.
I have this code for adding it:
DataGridViewComboBoxColumn colCombo = new DataGridViewComboBoxColumn();
colCombo.HeaderText = "State";
colCombo.Name = "combo";
colCombo.Items.Add("Open");
colCombo.Items.Add("Close");
dataGridView_targets.Columns.Add(colCombo);
This is what I see, clicking on the ComboBox doesn't work.
Upvotes: 2
Views: 2921
Reputation: 705
I followed your code snippet and everything worked as expected. My workflow was I created a winform app, added a datagridview to it and then took your code snippet and shoved it into the constructor. Are there any other pieces you have that might be influencing this result? Any other code you can post that may help the community answer better?
I did see that if the datagridview_targets.AllowUserToAddRows = false
, this can stop the combo box from being able to be used as intended. For some reason I cannot see the image you posted, so not sure what the exact result is that you are seeing.
Upvotes: 0
Reputation: 3084
This situation can be, if the property "ReadOnly" has value True for your DataGridView
Upvotes: 4