How can I set the menu control height?

Discussion in 'ASP .Net' started by John, Sep 16, 2008.

  1. John

    John Guest

    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>
    --------------------------------
     
    John, Sep 16, 2008
    #1
    1. Advertising

  2. 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! |
    ********************************************
    "John" <> wrote in message
    news:...
    > 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>
    > --------------------------------
     
    Cowboy \(Gregory A. Beamer\), Sep 17, 2008
    #2
    1. Advertising

  3. John

    John Guest

    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


    On Sep 16, 11:37 pm, "Cowboy \(Gregory A. Beamer\)"
    <> wrote:
    > 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 bloghttp://feeds.feedburner.com/GregoryBeamer#
    >
    > or just read it:http://feeds.feedburner.com/GregoryBeamer
    >
    > ********************************************
    > | Think outside the box!                               |
    > ********************************************"John" <> wrote in message
    >
    > news:...
    >
    >
    >
    > > 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>
    > > --------------------------------- Hide quoted text -

    >
    > - Show quoted text -
     
    John, Sep 18, 2008
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    1,477
  2. Bernd Meier
    Replies:
    6
    Views:
    529
    GTalbot
    Jan 14, 2008
  3. Perry Loh
    Replies:
    0
    Views:
    313
    Perry Loh
    Mar 24, 2006
  4. John

    How can I set the menu control height?

    John, Sep 16, 2008, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    176
  5. Don Vaillancourt

    How to tell height of div where height is not set?

    Don Vaillancourt, Jan 28, 2005, in forum: Javascript
    Replies:
    8
    Views:
    155
    Dietmar Meier
    Jan 31, 2005
Loading...

Share This Page