Sizing RadMenu to width of menu items

4 posts, 0 answers
  1. Henry Huey
    Henry Huey avatar
    2 posts
    Member since:
    Jun 2006

    Posted 15 Dec 2009 Link to this post

    I have a RadMenu created in a code-behind, with these properties (among others):

    NavMenu.EnableAutoScroll = true;
    NavMenu.EnableScreenBoundaryDetection = true;
    NavMenu.Width = Unit.Percentage(99);

    I set the Width to 99% to enable the menu scroll arrows when the browser window is resized.  Menu items are added through code, instead of markup.

    The issue I want to fix is that the menu covers the width of the client area, regardless of the number of menu items.  I'd like for the menu to be sized to just the width of the items, but still have the menu scroll arrows.  My application's menu is configured based on licensing and security, and so the number of menu items varies widely.

    Thanks! 

  2. Yana
    Admin
    Yana avatar
    4848 posts

    Posted 18 Dec 2009 Link to this post

    Hi Henry,

    I am not completely sure what you're trying to achieve - when the items are not so much and scroll is not needed , the menu should be the same width as items (not 995) - is that the scenario?


    Greetings,
    Yana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Henry Huey
    Henry Huey avatar
    2 posts
    Member since:
    Jun 2006

    Posted 04 Jan 2010 Link to this post

    Attached is a screenshot of a sample menu with seven root menu choices and width of 99%.

    I’d like for the menu to end after the “BusinessCalendar2” menu item, with white space to the width of the browser window.  If the browser window is resized from the right, then I want the menu scroll arrows to appear when the window is narrow enough (EnableRootItemScroll = true). 

  4. Yana
    Admin
    Yana avatar
    4848 posts

    Posted 05 Jan 2010 Link to this post

    Hi Henry,

    Thank you for sending the screenshot.

    I'm afraid that RadMenu doesn't support this scenario - the scroll arrows cannot appear when the page is resized, because they're not rendered at all in this case. RadMenu should have set Width property in order to use its scrolling mechanism.


    All the best,
    Yana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top