private void BaseCariBarangView_KeyDown(object sender, KeyEventArgs e) { switch (e.KeyCode) { case Keys.F2: listDataGrid.ClearSelection(); textBoxPencarian.SelectAll(); textBoxPencarian.Focus(); break; case Keys.Up: case Keys.Down: if (textBoxPencarian.Focused) { listDataGrid.SelectedIndex = 0; } break; case Keys.Enter: OnEnterKeyDown?.Invoke(sender, e); break; case Keys.Escape: Close(); break; } }
private void listDataGrid_CellDoubleClick(object sender, CellClickEventArgs e) { OnEnterKeyDown?.Invoke(sender, e); }