Skip to content

Instantly share code, notes, and snippets.

@Zujaj
Last active October 12, 2020 10:25
Show Gist options
  • Save Zujaj/35074940524708c88ffad3a4f5a098a0 to your computer and use it in GitHub Desktop.
Save Zujaj/35074940524708c88ffad3a4f5a098a0 to your computer and use it in GitHub Desktop.
Demonstrates KeyDown event of DataGridView
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