Do not enter edit mode on enter/arrow keys

2 posts, 0 answers
  1. Alexander
    Alexander avatar
    78 posts
    Member since:
    Apr 2013

    Posted 24 Feb 2016 Link to this post

    Is there a way to _not_ enter the edit mode if the user changes the selected cell using the arrow keys or by pressing enter?
    (Event if the user was in edit mode before). I want to get closer to the behavior of excel.


  2. Stefan
    Stefan avatar
    1073 posts

    Posted 29 Feb 2016 Link to this post

    Hello Alex,

    For this requirement, you can benefit from the KeyBoard Command Provider mechanism which RadGridView supports. Basically, within the overriden ProvideCommandsForKey() method, you can implement logic as suggested in the snippet below.
    public override IEnumerable<ICommand> ProvideCommandsForKey(Key key)
        List<ICommand> commandsToExecute = base.ProvideCommandsForKey(key).ToList();
        if (key == Key.Enter)
        if (key == Key.Tab)
        return commandsToExecute;

    Can you please give the suggestion a try and let me know how it goes?

    Best Regards,
    Stefan X1
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top