How to open context menu using keyboard

5 posts, 0 answers
  1. Som
    Som avatar
    35 posts
    Member since:
    Oct 2007

    Posted 21 Dec 2007 Link to this post

    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

  2. Erjan Gavalji
    Admin
    Erjan Gavalji avatar
    1455 posts

    Posted 27 Dec 2007 Link to this post

    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
  3. Som
    Som avatar
    35 posts
    Member since:
    Oct 2007

    Posted 27 Dec 2007 Link to this post

    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
  4. Erjan Gavalji
    Admin
    Erjan Gavalji avatar
    1455 posts

    Posted 28 Dec 2007 Link to this post

    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
  5. Kai
    Kai avatar
    23 posts
    Member since:
    Jun 2009

    Posted 08 Jan 2010 Link to this post

    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
Back to Top