After I set \"EditOnEnter\" to be true, the DataGridViewComboBoxCell
still takes two clicks to open if I don\'t click on the down arrow part of the combo box.>
I used this solution as it avoids sending keystrokes:
Override the OnCellClick method (if you're subclassing) or subscribe to the CellClick event (if you're altering the DGV from another object rather than as a subclass).
protected override void OnCellClick(DataGridViewCellEventArgs e)
{
// Normally the user would need to click a combo box cell once to
// activate it and then again to drop the list down--this is annoying for
// our purposes so let the user activate the drop-down with a single click.
if (e.ColumnIndex == this.Columns["YourDropDownColumnName"].Index
&& e.RowIndex >= 0
&& e.RowIndex <= this.Rows.Count)
{
this.CurrentCell = this[e.ColumnIndex, e.RowIndex];
this.BeginEdit(false);
ComboBox comboBox = this.EditingControl as ComboBox;
if (comboBox != null)
{
comboBox.DroppedDown = true;
}
}
base.OnCellContentClick(e);
}