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

AccessKeys not working in RibbonView

1 Answer 38 Views
RibbonView and RibbonWindow
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 17 May 2016, 02:45 PM

I am experiencing some problems making AccessKeys work the way I understand they should in a RadRibbonView.

I have a sample application to demonstrate the problem, but I do not know how to make it available.  When the application is running, pressing Ctrl+D should activate the click event of a RadRibbonButton.  Note that I configure the AccessKeys property in the initialized event of the button as follows:

private void RadRibbonButton_Initialized(object sender, EventArgs e)
{
    ((RadRibbonButton)sender).SetValue(KeyTipService.AccessKeysProperty, new Collection<KeyGesture>() { new KeyGesture(Key.D, ModifierKeys.Control) });
}

This is my xaml code for the ribbon:

<telerik:RadRibbonView Grid.Row="0" VerticalAlignment="Top" Grid.ColumnSpan="2" telerik:KeyTipService.IsKeyTipsEnabled="true">
            <telerik:RadRibbonTab Header="RibbonTab" telerik:KeyTipService.AccessText="R" >
                <telerik:RadRibbonGroup>
                    <telerik:RadRibbonButton telerik:KeyTipService.AccessText="H" telerik:KeyTipService.AccessKey="Ctrl+D" Click="RadRibbonButton_Click" Text="Test" Initialized="RadRibbonButton_Initialized" />
                </telerik:RadRibbonGroup>
            </telerik:RadRibbonTab>
        </telerik:RadRibbonView>

What can I do to get this working?

1 Answer, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 20 May 2016, 02:30 PM
Hi Thomas,

Unfortunately RibbonView does not support complex AccessKeys at the moment but only such that have one letter. I would highly recommend that you use KeyBinding with custom Command instead where the Command executes whatever you wanted to happen on Click. You might search for an online example of this as it is a common WPF approach and not something specific to our controls.

Regards,
Evgenia
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
RibbonView and RibbonWindow
Asked by
Thomas
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Share this question
or