Michael
Michael

Reputation: 13616

How to open combo box of Datagridview cell from the first click

I have DataGridView whith Column of comboboxes.

I have to click twice the cell in order combo to be opened.

Anyone knows how may I make it to be opened from the first click.

Thank you in advance.

Upvotes: 2

Views: 6626

Answers (2)

Taraz
Taraz

Reputation: 1331

Here's an easier way:

In the CellEnter event, check if the column index corresponds with the combobox column. If it does, set

DataGridView.EditMode = DataGridViewEditMode.EditOnEnter; 

or if it's a regular column, set it to the default

DataGridView.EditMode = DataGridViewEditMode.EditOnKeystrokeOrF2; 

Upvotes: 0

Related Questions