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

Shortcut keys to open RadContextMenu

2 Answers 236 Views
ContextMenu
This is a migrated thread and some comments may be shown as answers.
Hadrien
Top achievements
Rank 1
Hadrien asked on 05 Dec 2012, 09:42 AM
Hi,

I have a RadContextMenu inside a RadGridView and it works fine. So each row in RadGridView has is own RadContextMenu.
Now I would like to add some shortcut keys in order to get a context menu open in some submenu or to "click" automatically a submenu.

What do you suggest?

Thanks,

2 Answers, 1 is accepted

Sort by
0
Rosen Vladimirov
Telerik team
answered on 05 Dec 2012, 12:56 PM
Hello,

RadContextMenu has IsOpen property - you can use it to open or close it. I'm attaching a simple project where when you use LeftCtrl button RadContextMenu will open. Note that the focus of your application shoudl be on the item on which RadContextMenu is attached. Unfortunately there's no easy way to implement opening of submenus. Each RadMenuItem has IsSubMenuOpen property and you can use it, but there are several problems you may face. That's why I suggest you to use the approach from the attachment and use keyboard naviagtion to open the desired menu.

Please check the attachment and inform us if you have any concerns.

Greetings,
Rosen Vladimirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Accepted
Rosen Vladimirov
Telerik team
answered on 05 Dec 2012, 01:26 PM
Hello Hadrien,

I just want to share some more information with you. You can use access keys in RadContextMenu. To set an access key you should use the special symbol "_" in the Header of RadMenuItems. For example if your header is "_Item 1" and when RadContextMenu is opened you press the button "I" from the keyboard Item 1 will be clicked if it doesn't have subitems or its submenu will be opened if such exists. I've modified the solution from my previous post and now it uses Access key and after you open RadContextMenu with LeftCtrl you will be able to use them. You can find it attached.

Another thing that you can use is opening RadContextMenu on specific event. More information about this can be found in our online help.

Hopefully this helps.

All the best,
Rosen Vladimirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
ContextMenu
Asked by
Hadrien
Top achievements
Rank 1
Answers by
Rosen Vladimirov
Telerik team
Share this question
or