How can I set the menu control height?

J

John

Hi,

I have a page with a scrollable DIV, and within that DIV, I have a few
asp.net menu controls. The idea being, the user mouses over the small
icons and is presented with a list of options.

One of these lists has more data than the page allows for, so the menu
control automatically creates the scroll up / scroll down commands at
both ends of the menu. The problem is; since it is within a
scrollable div, the menu scroller are hidden! The user needs to
scroll the div, in order to scroll the menu!

I'm attempting to resolve this, by making the menu shorter, but the
height property doesn't appear to work.

I've attached concise sample code below, and as you can see I want the
menu to be 2 inches long. The background is only colored for 2 inches,
but the menu goes the full length of the window.

I've also attempted to resolve it by adding the following code to the
top of the page, but when the user tries to scroll it, the menu
disappears.
--------------------------------
<style>#ctl01n0Items {height:2in;overflow-y:auto;}</style>
--------------------------------

So my question is :
Does anybody know how to set the height of the menu?
Or
Does anybody know how to get the menu to autosize according to it's
container, not the full window client area.

Thanks in advance, I'm hoping I'm missing something simple.

Regards,
John

--------------------------------
<asp:menu
DynamicMenuStyle-Height="2in"
DynamicMenuStyle-BackColor="LightBlue"
runat="server">
<items>
<asp:menuitem text="My Menu">
<asp:menuitem text="Item 1"/>
<asp:menuitem text="Item 2"/>
<asp:menuitem text="Item 3"/>
<asp:menuitem text="Item 4"/>
<asp:menuitem text="Item 5"/>
<asp:menuitem text="Item 6"/>
<asp:menuitem text="Item 7"/>
<asp:menuitem text="Item 8"/>
<asp:menuitem text="Item 9"/>
<asp:menuitem text="Item 10"/>
<asp:menuitem text="Item 11"/>
<asp:menuitem text="Item 12"/>
<asp:menuitem text="Item 13"/>
<asp:menuitem text="Item 14"/>
<asp:menuitem text="Item 15"/>
<asp:menuitem text="Item 16"/>
<asp:menuitem text="Item 17"/>
<asp:menuitem text="Item 18"/>
<asp:menuitem text="Item 19"/>
<asp:menuitem text="Item 20"/>
<asp:menuitem text="Item 21"/>
<asp:menuitem text="Item 22"/>
<asp:menuitem text="Item 23"/>
<asp:menuitem text="Item 24"/>
<asp:menuitem text="Item 25"/>
<asp:menuitem text="Item 26"/>
<asp:menuitem text="Item 27"/>
<asp:menuitem text="Item 28"/>
<asp:menuitem text="Item 29"/>
<asp:menuitem text="Item 30"/>
</asp:menuitem>
</items>
</asp:menu>
--------------------------------
 
C

Cowboy \(Gregory A. Beamer\)

Try the CSS Friendly adapters. You then have a better CSS experience and can
control many of the display elements better than you can with the default
(tables).

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
 
J

John

Hi Gregory,

Thanks for the idea, I've never heard of control adapters before. I'm
glad I now know about it.

Anyway, I wound up grouping the items into submenus so I could resolve
the situation immediately and deploy. And I don't know if
implementing control adapters is worth the effort at this point
anyway.

Thanks you for the response though.

Sincerely,
John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top