Last active
October 12, 2020 10:25
-
-
Save Zujaj/35074940524708c88ffad3a4f5a098a0 to your computer and use it in GitHub Desktop.
Demonstrates KeyDown event of DataGridView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void dataGridView1_KeyDown(object sender, KeyEventArgs e) | |
{ | |
if (e.Alt | |
&& (e.KeyCode == Keys.Down || e.KeyCode == Keys.Up) | |
&& dataGridView1.CurrentCell != null | |
&& dataGridView1.CurrentCell.OwningColumn.HeaderCell is DataGridViewAutoFilterColumnHeaderCell filterCell) | |
{ | |
filterCell.ShowDropDownList(); | |
e.Handled = true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment