Horizontal Scroll Bar for listbox

Discussion in 'ASP .Net' started by Lloyd Sheen, Oct 31, 2003.

  1. Lloyd Sheen

    Lloyd Sheen Guest

    I have searched wide and far through google for a solution to no avail. Is
    there a method available to add a horizontal scroll bar to a listbox in
    asp.net.

    Thanks in advance
     
    Lloyd Sheen, Oct 31, 2003
    #1
    1. Advertising

  2. Lloyd,

    It's not directly possible. This has nothing to do with ASP.NET. Rather,
    it is a limitation of the HTML select element (which is how the ASP.NET
    listbox is rendered in the browser). One workaround would be to wrap your
    wide listbox in a div or span of the desired width, then set the wrapper
    element to use a scrollbar on horizontal overflow. e.g.:

    <div style="width:80px; overflow-x:auto">
    <asp:ListBox id=YourListBox runat="server"></asp:ListBox>
    </div>

    HTH,
    Nicole


    "Lloyd Sheen" <> wrote in message
    news:puCob.80149$...
    > I have searched wide and far through google for a solution to no avail.

    Is
    > there a method available to add a horizontal scroll bar to a listbox in
    > asp.net.
    >
    > Thanks in advance
    >
    >
     
    Nicole Calinoiu, Nov 1, 2003
    #2
    1. Advertising

  3. A listbox is just a SELECT element.
    If you need horizontal scrolling, wrap the listbox with a DIV or SPAN.
    A

    "Lloyd Sheen" <> wrote in message
    news:puCob.80149$...
    > I have searched wide and far through google for a solution to no avail.

    Is
    > there a method available to add a horizontal scroll bar to a listbox in
    > asp.net.
    >
    > Thanks in advance
    >
    >
     
    Andrew de la Harpe, Nov 1, 2003
    #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. Jeremy Chapman
    Replies:
    1
    Views:
    932
    szabelin
    Aug 15, 2003
  2. RJN
    Replies:
    1
    Views:
    5,706
    jongalloway
    Mar 5, 2005
  3. ray well

    auto scrolling horizontal scroll bar

    ray well, Apr 4, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    634
    ray well
    Apr 5, 2005
  4. J-T
    Replies:
    7
    Views:
    918
  5. =?Utf-8?B?VmlkZHM=?=
    Replies:
    3
    Views:
    13,385
    Craig Deelsnyder
    Nov 23, 2005
Loading...

Share This Page