How to programmatically execute the Fill Down/Right command

3 posts, 0 answers
  1. Edward
    Edward avatar
    5 posts
    Member since:
    Apr 2014

    Posted 23 Jun 2014 Link to this post

    The spreadsheet control doesn't seem to intercept user keystrokes.
    Is there some setting to capture and execute this?  I see Ctr+D and Ctr+R shortcuts for the Fill Down/Right menu items, but when I press these keys, the browser intercepts them or they don't get executed.

    Is there a way set it to execute these commands by keystroke, or at least a way to programmatically execute these fill commands by intercepting the KeyDown event in code.
  2. Edward
    Edward avatar
    5 posts
    Member since:
    Apr 2014

    Posted 23 Jun 2014 in reply to Edward Link to this post

    Using:

     radSpreadsheet.ActiveWorksheetEditor.KeyDown += (s, e) =>
                    {
                        if (Keyboard.Modifiers == ModifierKeys.Control && e.Key == Key.D)
                        {
                            radSpreadsheet.ActiveWorksheetEditor.Commands.FillDown.Execute(null);
                            e.Handled = true;
                        }
                        else if (Keyboard.Modifiers == ModifierKeys.Control && e.Key == Key.R)
                        {
                            radSpreadsheet.ActiveWorksheetEditor.Commands.FillRight.Execute(null);
                            e.Handled = true;
                        }
                    };  

    It doesn't get caught.  Instead the browser key event for adding favorites (for e.g. when doing Ctr+D) get raised.







  3. DevCraft banner
  4. Nikolay Demirev
    Admin
    Nikolay Demirev avatar
    103 posts

    Posted 24 Jun 2014 Link to this post

    Hello Edward,

    I have attached a sample project showing how to set custom command for the Ctrl+C shortcut. The same way you can define custom shortcut keys or override existing ones.

    I hope this is helpful. If you have any other question do not hesitate to contact us again.

    Regards,
    Nikolay Demirev
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top