Groups | Blog | Home
all groups > asp.net > october 2003 >

asp.net : Horizontal Scroll Bar for listbox



Nicole Calinoiu
10/31/2003 7:46:54 PM
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


[quoted text, click to view]

Lloyd Sheen
10/31/2003 11:45:51 PM
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
11/1/2003 11:56:04 AM
A listbox is just a SELECT element.
If you need horizontal scrolling, wrap the listbox with a DIV or SPAN.
A

[quoted text, click to view]

AddThis Social Bookmark Button