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

How to open context menu using keyboard

4 Answers 156 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Som
Top achievements
Rank 1
Som asked on 21 Dec 2007, 09:56 PM
Is there a way to open the context menu of the tree view using the keyboard (in order to make it 508 compliant)? Even if it does not open next to the  node it's fine.

Thanks for your help,
Som

4 Answers, 1 is accepted

Sort by
0
Erjan Gavalji
Telerik team
answered on 27 Dec 2007, 11:24 AM
Hi Som,

Please, find attached a sample page I just created, demonstrating how to achieve calling the context menu through a key click. Currently the context menu gets opened on "c" key click.

The code uses some private methods of RadTreeView, but we will do our best to implement a proper client-side event to make this task easier for the official service pack of the "Prometheus" suite.

Kind regards,
Erjan Gavalji
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Som
Top achievements
Rank 1
answered on 27 Dec 2007, 06:44 PM
Thanks Erjan. That works, but in order to make it work with the keyboard I need to execute the menu options also using the keyboard. I have assigned the AccessKeys to the Menu Items but they only hightlight the menu and do not execute it. The only client side event I have been able to find so far is OnClientContextMenuItemClicked (mouse event). So, now I am trying to execute the menu item using the keyboard.

Som
0
Erjan Gavalji
Telerik team
answered on 28 Dec 2007, 12:40 PM

Hi Som,

Thanks to the scenario you requested, after some more testing we found several glitches and we imlpemented some additions to the context menu functionality of RadTreeView "Prometheus". What we did was:
    - expose a new client event, named keyDown - now you are able to attach to this event and add code to be executed in a key down (e.g. open a context menu);
    - expose a method to the RadTreeView client object, named showNodeContextMenu - it allows to specify a node to which a context menu will be open.

Please, find the reworked example attached and the latest internal build also. I'd like to remind that this build is not official, but meant for testing purposes only and there might be some untested glitches yet.

Back to the e-mail:
Pressing the TAB key would set the focus to the context menu, where you can navigate through the items using the arrow keys and press ENTER to have the menu item's click event fired.

Let me know if everything is fine now.

Best,
Erjan Gavalji
the Telerik team


Instantly find answers to your questions at the new Telerik Support Center
0
Kai
Top achievements
Rank 1
answered on 08 Jan 2010, 02:12 PM
I'm trying to accomplish the same thing with my RadMenu in my TreeView and am wondering if there was a fix for this in the Q2 2009 version of the controls?  If not, is there a work around to get this working?

- Kai Thao
Tags
TreeView
Asked by
Som
Top achievements
Rank 1
Answers by
Erjan Gavalji
Telerik team
Som
Top achievements
Rank 1
Kai
Top achievements
Rank 1
Share this question
or