DataGridView KeyDown Event not working
问题 I have a DataGridView with a KeyDown event. void dataGridView1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.C && e.Modifiers == (Keys.Control | Keys.Shift)) { MessageBox.Show("ok"); // to test if working } } The message box prompts when I press the key combinations. But that is only when the datagridview is empty (no rows of data). The code doesn't work when the datagridview has rows already. Is there any wrong with the codes? 回答1: The KeyDown event handler doesn't fire when