Reputation: 10638
I have a datagridview which one of its columns is a datagridviewcomboboxcolumn. So I would like combobox to dropdown automatically on enter (click on the cell). I have overrided the OnEnter method and then do a SendKeys.Send("{F4}") but it is not working.
Upvotes: 0
Views: 1602
Reputation: 941
You can also set the edit mode of the datagridview to "EditOnEnter" and it would do the same thing. It would also force textbox columns to edit mode when you enter them as well.
Upvotes: 1
Reputation: 10638
Solved by handling cellEnter event:
private void OnDGVCellEnter(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex == this.colDesired.Index)
{
SendKeys.Send("{F4}");
}
}
Upvotes: 1