AccessKeys not working in RibbonView

2 posts, 0 answers
  1. Thomas
    Thomas avatar
    1 posts
    Member since:
    Jan 2016

    Posted 17 May 2016 Link to this post

    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:RadRibbonButton telerik:KeyTipService.AccessText="H" telerik:KeyTipService.AccessKey="Ctrl+D" Click="RadRibbonButton_Click" Text="Test" Initialized="RadRibbonButton_Initialized" />

    What can I do to get this working?

  2. Evgenia
    Evgenia avatar
    1437 posts

    Posted 20 May 2016 Link to this post

    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.

    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top