CustomKeyboardCommandProvider and Ctrl-Modifier

2 posts, 0 answers
  1. Markus
    Markus avatar
    9 posts
    Member since:
    Apr 2015

    Posted 04 Apr 2016 Link to this post


    I am having the following issue with my Custom KeyboadCommandProvider for RadGridView: If the user presses Ctrl+Down key, i want to select the third column of the next row. Therefore i move down once, check if Ctrl is pressed and if so, move to the first column and then twice to the Right. The problem is, that the Move-Commands also factor in the pressed shift key. Therefore the selection moves to the bottom of the list, then to the right and then twice to the end of the row. My code looks as follows:

    public class ScheduleKeyboardCommandProvider : DefaultKeyboardCommandProvider
        private GridViewDataControl parentGrid;

    public ScheduleKeyboardCommandProvider(GridViewDataControl grid)
    : base(grid)
    this.parentGrid = grid;

    public override IEnumerable<ICommand> ProvideCommandsForKey(Key key)
    List<ICommand> commandsToExecute = base.ProvideCommandsForKey(key).ToList();
    bool ctrlIsPressed = (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control;

    if (key == Key.Down)
    if (ctrlIsPressed)
    // move to first column and then move right twice

    return commandsToExecute;



    I would appreciate some tips. Thanks in advance.

  2. Yoan
    Yoan avatar
    1215 posts

    Posted 07 Apr 2016 Link to this post


    Can you consider selecting the third column with the following approach - Set the current cell?

    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top