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

Redirect the shortcut „Ctrl+S“

3 Answers 155 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 30 Oct 2015, 11:58 AM
Hello every body,

I am currently trying to custumize the RadSpreadsheet. My purpose is to redirect the shortcut  „Ctrl+S“  to my own custum command.
I tried this

<telerik:RadSpreadsheet x:Name="radSpreadsheet" >
            <telerik:RadSpreadsheet.InputBindings>
                <KeyBinding Gesture="Ctrl+S" Command="{Binding myCommand}"/>
            </telerik:RadSpreadsheet.InputBindings>
          ……
</telerik:RadSpreadsheet>

But I am still getting the default command. Is there any way to achieve what I want?
Just to make it clear. I did the same thing with RadRichTextBox

<telerik:RadRichTextBox x:Name="radRichTextBox" >
                    <telerik:RadRichTextBox.InputBindings>
                        <KeyBinding Gesture="Ctrl+S" Command="{Binding SaveFileCommand}" />
                    </telerik:RadRichTextBox.InputBindings>
                </telerik:RadRichTextBox>
</telerik:RadRichTextBox x:Name="radRichTextBox" >

it works well.

Please help.

Best regards

3 Answers, 1 is accepted

Sort by
0
Anna
Telerik team
answered on 03 Nov 2015, 12:21 PM
Hi,

For the RadSpreadsheet control, the key bindings are kept in the InputBindings collection of the RadWorksheetEditor, instead of that of RadSpreadsheet. The following line should do the trick:

this.radSpreadsheet.ActiveWorksheetEditor.KeyBindings.RegisterCommand(myCommand, Key.S, ModifierKeys.Control);

Let me know if you need anything further regarding this or any other matter.

Regards,
Anna
Telerik
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
0
Coopbase
Top achievements
Rank 2
Iron
Iron
answered on 05 Apr 2021, 12:26 PM

Hi,

 

Can u give complete code on how to achieve this?

 

Thanks,

 

Rene

 

0
Dimitar
Telerik team
answered on 06 Apr 2021, 05:10 AM

Hi,

You can find a complete example and all key combinations in our documentation: Keyboard support.

I hope this helps. Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Spreadsheet
Asked by
Alex
Top achievements
Rank 1
Answers by
Anna
Telerik team
Coopbase
Top achievements
Rank 2
Iron
Iron
Dimitar
Telerik team
Share this question
or