RadRibbonDropDownButton - Open on F2 key

4 posts, 0 answers
  1. Heiko
    Heiko avatar
    123 posts
    Member since:
    Oct 2012

    Posted 05 May 2015 Link to this post

    We have a RadRibbonDropDownButton declared inside a user control. What we like to achieve is to open the DropDown-Content by using F2 on the keyboard. Best would be without code behind (MVVM/PRISM). Unfortunately the "<UserControl.InputBindings>" are not working as expected. Is there another way to define a shortcut key on RadRibbonDropDownButton? n. b. this button is not inside a RibbonView, but used "as is" in a DockPanel.

    Regards
    Neils

  2. Kiril Vandov
    Admin
    Kiril Vandov avatar
    324 posts

    Posted 06 May 2015 Link to this post

    Hello Neils,

    Let me try to explain when the InputBindings will be fired. In a regular case in which you have window and some controls in, by default the focus is inside the Window, that is why if you declare an InputBindings for the Window they will be triggered. However in the case where you have UserControl inside the Window, the ImputBindings for the UserControl will not be fired, unless you focus it.
    If you entire application is hosted in that UserControl you could focus it once the is loaded and the bindings should work as expected. Another approach would be to declare the commands in both the Window and the UserControl to the same command. Using this approach will fire the command as you expected,

    I hope this information helps. Please let us know if you need further assistance.

    Kind regards,
    Kiril Vandov
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Heiko
    Heiko avatar
    123 posts
    Member since:
    Oct 2012

    Posted 07 May 2015 in reply to Kiril Vandov Link to this post

    Thanks Kiril, that brought some light on the matter. In my case (MVVM and PRISM) every View is a UserControl and is placed inside the ShellWindow via RegionManager. So there is no way to declare InputBindings in the ShellWindow.

    Is there a way to declare a keyboard shortcut on a telerik control, lets say "whenever I press F2, fire the click event"?

    Kind regards
    Neils

  5. Kiril Vandov
    Admin
    Kiril Vandov avatar
    324 posts

    Posted 08 May 2015 Link to this post

    Hello Neils,

    We does not have such functionality in our controls as it is against how the .NET Framework and RouternEvents works. KeyBoradEvents are not fires beyond the Scope of the UserControl, they are fired only for the Window and the currently focused UserControl, however if the focus is in the Window and not in the UserControl only the Window will receive the events.

    As a possible workaround for this scenario you could use the LoadedEvent of the UserControl and get its ParentWindow. After you get the Window you could subscribe to its KeyDownEvents and decide what to do when the Key you need is Pressed.

    I hope this information helps.

    Kind regards,
    Kiril Vandov
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top