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

KeyUp event is not fired

1 Answer 263 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Tan
Top achievements
Rank 1
Tan asked on 04 May 2015, 11:13 AM

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

1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 07 May 2015, 08:07 AM
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.

 
Tags
General Discussions
Asked by
Tan
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Share this question
or