Horizontal Scroll Bar for listbox

  • Thread starter Thread starter Lloyd Sheen
  • Start date Start date
L

Lloyd Sheen

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,

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
 
A listbox is just a SELECT element.
If you need horizontal scrolling, wrap the listbox with a DIV or SPAN.
A
 
Back
Top