private void ColumnShortcut_KeyPressEvent(object sender, CellKeyPressEventArgs args) { if (args.Editing && KeyShortcuts.CombinationValidForItem(args.EventKey)) { currentKey = new AccelKey(args.EventKey.Key, args.EventKey.State, AccelFlags.Visible); args.Entry.Text = KeyShortcuts.KeyToString(currentKey); args.MarkAsHandled(); } switch (args.EventKey.Key) { case Key.BackSpace: case Key.Delete: currentKey = AccelKey.Zero; args.Entry.Text = string.Empty; break; } gridNavigator.ColumnKeyPress(args, args.Cell.Column, ShortcutColumnEvaluate, ShortcutColumnEditPrev, ShortcutColumnEditNext); }
private bool ShortcutColumnEvaluate(int row, string value) { bool combinationValid = KeyShortcuts.CombinationValidForItem(currentKey) || currentKey.Key == 0; if (!combinationValid || row >= itemShortcuts.Count) { return(false); } if (!UsedInMenu(row)) { return(false); } if (!UsedWithAnotherItem(row)) { return(false); } itemShortcuts [row].Shortcut = currentKey; return(true); }