Controlling the number of lines displayed in the dropdown menu
If ASP.NET renders the DropDownList control as <select>
, then there is no <select>
browser-dependent way to control the number of rows displayed when opened .
A quick test shows that IE 6 displays 27 items out of a list of 27 items, Safari for Windows 3.2.1 shows 22, Firefox 2 shows 20, and Opera 9.6.2 shows 16. The number of detected items may even depend on the total, but I did not check this is because it is pretty obvious, it is not something that you can control.
Adding size="..."
to the control will cause the dropdown to be fixed and it will no longer be a "dropdown" (if you can even do that).
The only solution for this seems to be to implement your own JavaScript based dropdown or buy or download.
source to share