Hi,
I have a drop down list of around 30 items and I want to only show 8 items and then the drop down should scroll. I'm using MVC2 in VS2010
<%= Html.DropDownListFor(d => d.Thing.ThingID, Model.Things, new { style = "width: 200px", rows = 10 })%>
Hi,
I have a drop down list of around 30 items and I want to only show 8 items and then the drop down should scroll. I'm using MVC2 in VS2010
<%= Html.DropDownListFor(d => d.Thing.ThingID, Model.Things, new { style = "width: 200px", rows = 10 })%>
have you tried size
instead of rows
?
<%= Html.DropDownListFor(d => d.Thing.ThingID, Model.Things, new { style = "width: 200px", size = 10 })%>
According to the w3 http://www.w3schools.com/tags/att_select_size.asp size is the attribute you're looking for.
After reading your response the answer appears to be that it's operating system/browser independent and not possible to control through html. What you could do is override the select box with an HTML only version. You could do something like on this site: http://mypocket-technologies.com/jquery/SelectBoxPlugin/ However it may cause other problems and won't look like a standard list box.