Click here to Skip to main content
15,877,915 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am having two drop down list adjacent to each other. One is used to select hour and another for minute. So hour drop down list contains 24 items and minute drop down list contains 59 items. I want that both drop down list should show 5 items and other items on scroll.

<asp:DropDownList ID="dropDownHr" runat="server" >

<asp:DropDownList ID="dropDownMin" runat="server" >

Thanks for help in advance.

Share this answer
Ami_Modi 17-Feb-14 0:06am    
I don't have DropDownExtender in Ajax control list. Help me what to do.
Try to use below code.
<asp:DropDownList runat="server" ID="ddlColors" onmousedown="this.size=5;"  >
        <asp:ListItem>no color</asp:ListItem>

  height: 300px;
  max-height: 300px;
  overflow-y: scroll;
Share this answer
Krunal Rohit 16-Feb-14 23:37pm    
you forget to apply CSS
<asp:DropDownList ID="" runat="" CssClass="dropmenudiv">

Ami_Modi 17-Feb-14 0:04am    
None of them is working as I want.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900