i am working with DataGridView trying to provide specific ut开发者_如何学Pythonility to my user...
what i want to do is when some key is presses instead of the normal function that the key was supposed to perform like updown arrows and page up down keys etc i want to stop the default action
like when on a selected row, datagrid in selectfullrow
, when down arrow is press it shouldn't change the row selection or goto the next row
You should handle the KeyDown event and set the e.Handled to true to disable the default action:
private void dataGridView1_KeyDown(object sender, KeyEventArgs e) {
e.Handled = e.KeyCode == Keys.Down;
}
精彩评论