Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DataGridviewComboBox requires 2 clicks to show the list of items [duplicate]

Possible Duplicate:
Open dropdown(in a datagrid view) items on a single click

We have a DataGridView where one column is a ComboBox with the DropDownButton style. The DataGridView is in FullRowSelect mode. Let's assume that I have 5 rows, and row 0 is selected in the DataGridView.

I want to select an item from the ComboBox of -say for example- row 2, therefore I click the little arrow of the ComboBox. When I do this, first, row 2 of the DataGridView is selected. The ComboBox does not open yet. Only the second click opens the ComboBox.

In fact, it used to require 3 clicks, but then we overloaded the CellMouseDown to do:

myDataGridView.ClearSelection();
myDataGridView.Rows[e.RowIndex].Selected = true;

With this, we're down to 2 clicks. Is there a way to show the ComboBox items with one click only?

Edit: I should also mention that, instead of clicking on the little arrow of the ComboBox, if I click the ComboBox itself, it takes 3 clicks to show the ComboBox items!

like image 416
SomethingBetter Avatar asked Dec 28 '22 17:12

SomethingBetter


1 Answers

Set your DataGridView's EditMode property to EditOnEnter

like image 115
Jay Riggs Avatar answered Dec 31 '22 13:12

Jay Riggs