The problem with CellDoubleClick
is it won't fire an event for keyboard users when navigating with arrows.
Instead, some other events you can handle are:
You can poke around when each fires by attaching handlers to each event and writing to the output window:
dataGridView1.RowEnter += dgv_RowEnter;
dataGridView1.SelectionChanged += dgv_SelectionChanged;
dataGridView1.RowStateChanged += dgv_RowStateChanged;
dataGridView1.CellContentClick += dgv_CellContentClick;
private void dgv_RowEnter(object sender, DataGridViewCellEventArgs e)
{
Debug.WriteLine("RowEnter");
}
private void dgv_SelectionChanged(object sender, EventArgs e)
{
Debug.WriteLine("SelectionChanged");
}
private void dgv_RowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
{
Debug.WriteLine("RowStateChanged");
}
private void dgv_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
Debug.WriteLine("CellContentClick");
}