KeyUp event is not fired

2 posts, 0 answers
  1. Tan
    Tan avatar
    1 posts
    Member since:
    May 2015

    Posted 04 May 2015 Link to this post

    Hi all,

    I have a problem with KeyUp event on a RadMenuItem. When I tab to change the focus of an element from textblock to RadMenuItem, it changes as usual but when I pressed the Enter button the focus would be changed automatically from RadMenuItem to the previous textblock but other buttons work properly. What I want is firing a pressing Enter button event to do some activities.

    <telerik:RadMenuItem Header="{Binding DisplayHeader}" ItemsSource="{Binding Buttons}" ItemContainerStyleSelector="{StaticResource PageActionCustomButtonItemTemplate}" KeyboardNavigation.IsTabStop="False">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="KeyUp">
                        <cal:ActionMessage MethodName="PressingEnter">
                            <cal:Parameter Value="$eventArgs"/>
                        </cal:ActionMessage>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </telerik:RadMenuItem>

     Thanks,
    Tan

  2. Nasko
    Admin
    Nasko avatar
    587 posts

    Posted 07 May 2015 Link to this post

    Hello Tan,

    The observed by you behavior of RadMenu is an expected one. Inside the implementation of the control we handle the pressing of the "Enter" key. When you press that key the logic that is executed is:
    - if RadMenuItem has children pressing "enter" will cause the sub-menu of the item to be opened;
    - if RadMenuItem does not have children pressing "enter" will click the item - you could easily check that by handling the Click event;

    Unfortunately, we could not suggest you any proper approach how to fire the KeyUp event when "enter' key is pressed.

    Hopes the provide information will help you.

    Regards,
    Nasko
    Telerik
     

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

     
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top