Horizontal Scroll Bar for listbox

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
 
N

Nicole Calinoiu

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

Andrew de la Harpe

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

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top