DataGridView with DataGridViewComboBoxColumn: How to single click for dropdown list?
Posted on 2006-06-27
I have DGV on a form that is working perfectly well, except I want a single click on the cell to begin editing rather than clicking two times. For example, I would like a single click on a DataGridViewComboBoxColumn's cell to cause the dropdown list to appear and a single click on a DataGridViewTextBoxColumn to permit the user to start editing the contents. I have the written the following code, which is attached to the MouseUp event, but I am not certain what I should have it do to the cell to achieve my goals. I've tried setting focus on mouse up, but to no avail.
Thanks in advance for the help!
private void dataGridView_MouseUp(object sender, MouseEventArgs e)
DataGridView.HitTestInfo hti = dataGridView.HitTest(e.X, e.Y);
if (hti.Type == DataGridViewHitTestType.Cell)
// What to do here????
catch (Exception ex)