Enter key event for RadMenuItem

1 posts, 0 answers
  1. Bhavik
    Bhavik avatar
    13 posts
    Member since:
    Oct 2010

    Posted 29 Dec 2011 Link to this post

    Hi,

    I am using RadMenu for my website. I want to make the menu entirely keyboard friendly. Using AccessKey I can Navigate to a specific menu item but pressing Enter key does not do any thing. I want to fire the same event with the enter key which fires when we click the menu item.
    Following is my code snippet:

    <radM:RadMenu ID="RadMenu1" runat="server" UseEmbeddedScripts="False" Skin="System"
                                                CausesValidation="False" OnClientItemFocus="OnClientItemFocus">
                                                <Items>
                                                    <radM:RadMenuItem ID="RadMenuItem_Home" runat="server" Text="Home"   NavigateUrl="Default.aspx">
                                                    </radM:RadMenuItem>
                                                    <radM:RadMenuItem ID="RadMenuItem_Create" runat="server" Text="Create" AccessKey="C">
                                                        <Items>
                                                            <radM:RadMenuItem ID="abc" runat="server" Text="abc"
                                                                NavigateUrl="abc.aspx">
                                                            </radM:RadMenuItem>
                                                            <radM:RadMenuItem ID="xyz" runat="server" NavigateUrl="xyz.aspx"
                                                                Text="xyz">
                                                            </radM:RadMenuItem>                                                      
                                                        </Items>
                                                    </radM:RadMenuItem>
    <radM:RadMenu>

    Here when the focus is on Menu Item "xyz", when I press enter, I want it to navigate to URL: xyz.aspx

    Thanks,
    Bhavik
Back to Top