+1-888-365-2779
Try Now
More in this section

Forums / Set-up & Installation / SiteMenu items accesskey

SiteMenu items accesskey

5 posts, 0 answered
  1. Jeremy
    Jeremy avatar
    37 posts
    Registered:
    17 Jan 2011
    03 Dec 2008
    Link to this post
    I have a SiteMenu in my templates and I'm trying to figure out how to set the AccessKey for each menu item. I expected to find this in the Properties of each page, but found nothing there or anywhere else. Do I need to hard code a menu in order to be able to set the accesskey for each menu item?

    Thanks,

    Jeremy
  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    08 Dec 2016
    04 Dec 2008
    Link to this post
    Hi Jeremy,

    Please review the following online demo: Keyboard support

    You could use the AccessKey property of the RadMenuItem class to associate an activation combination (access key) which will focus on the particular menu item. So a possible solution is to implement the required functionality in the handler of OnItemDataBound event. For example:

    public void RadMenu1_ItemDataBound(object sender, RadMenuEventArgs e) 
        { 
            string s = e.Item.Text.Substring(0, 1); 
            e.Item.AccessKey = s; 
            ... 

    Also, you need to set the AccessKey property of the menu itself to activate it.

    Hope this helps.

    Regards,
    Pepi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Jeremy
    Jeremy avatar
    37 posts
    Registered:
    17 Jan 2011
    04 Dec 2008
    Link to this post
    Thank you for your response. I'm familiar with RadControls. I was really hoping to not have to mess with the core files in order to set the AccessKey. While your solution worked, I'd like to suggest that the Sitefinity team consider adding a property to set from the Page Properties.  I'll submit a feature request from My Client.net.

    Thanks,

    Jeremy
  4. Pepi
    Pepi avatar
    981 posts
    Registered:
    08 Dec 2016
    05 Dec 2008
    Link to this post
    Hello Jeremy,

    Actually, the best approach is to make a copy of Sitefinity Site Menu control and modify the copy instead of the original. Thus you will avoid losing the changes in case of upgrade.

    Regarding your request to set AccessKey property through Control Properties window, the solution is to implement your own Control Designer (the properties in the Basic tab) for the Site Menu user control. For details how to achieve this refer to the following Developer Manual Topic: Implementing Control Designers

    Do let us know if you need any further assistance.

    Greetings,
    Pepi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Jeremy
    Jeremy avatar
    37 posts
    Registered:
    17 Jan 2011
    05 Dec 2008
    Link to this post
    Thank you for those tips.
Register for webinar
5 posts, 0 answered