This is a migrated thread and some comments may be shown as answers.

How to programmatically execute the Fill Down/Right command

2 Answers 59 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Edward
Top achievements
Rank 1
Edward asked on 23 Jun 2014, 04:06 PM
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 Answers, 1 is accepted

Sort by
0
Edward
Top achievements
Rank 1
answered on 23 Jun 2014, 08:10 PM
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.







0
Nikolay Demirev
Telerik team
answered on 24 Jun 2014, 11:10 AM
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.
 
Tags
Spreadsheet
Asked by
Edward
Top achievements
Rank 1
Answers by
Edward
Top achievements
Rank 1
Nikolay Demirev
Telerik team
Share this question
or