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

[Solved] Sizing RadMenu to width of menu items

3 Answers 435 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Henry Huey
Top achievements
Rank 1
Henry Huey asked on 15 Dec 2009, 05:35 PM

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! 

3 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 18 Dec 2009, 10:18 AM
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.
0
Henry Huey
Top achievements
Rank 1
answered on 04 Jan 2010, 10:52 PM

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). 

0
Yana
Telerik team
answered on 05 Jan 2010, 04:03 PM
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.
Tags
Menu
Asked by
Henry Huey
Top achievements
Rank 1
Answers by
Yana
Telerik team
Henry Huey
Top achievements
Rank 1
Share this question
or