How to avoid multiple clicks on a DataGridViewComboBoxCell?

If you have used DataGridViewComboBoxColumn on a DataGridView, you must have the experience of clicking a DataGridViewComboBoxCell multiple times before the dropdown list shows itself. This can be annoying. One quick fix is to set the EditStyle of the DataGridView to EditOnEnter. This has a small bug which only happens when the row selection mode is allowed. Be specific, when you set the EditStyle to EditOnEnter and you select a whole row by selecting the row header, the row is selected and one cell will be in edit mode, which is not the desired behavior. There is a workaround: http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=98504.

Until next time, happen coding!

Leave a comment