Can we Resize a DropDown Item list Height ? [Resolved]

Posted by Chvrsri under ASP.NET on 5/27/2011 | Points: 10 | Views : 17235 | Status : [Member] [Moderator] [MVP] | Replies : 2
Hi All,

I am encountering a small problem can we change the height of the drop down list items ? For me the height is adjusted according to the number values that are being binded from database. setting maximum records to the drop down list is not possible and i cannot create a custom control as well because the requirement is as such.

So is there any other way to limit the height of the values binded to my drop down ?

Thanks.

Thanks,
Radha Srikanth



Responses

Posted by: Ndebata on: 5/27/2011 [Member] Starter | Points: 50

Up
0
Down

Resolved
Hi
Actually in ASP.NET Dropdownlist you can not control display items height, unless your are building your own.
But there are some crude ways you can control the same like onmouse over and out just set the item size like bellow.
<asp:DropDownList ID="DropDownList1" onmouseover="this.size=4;" onmouseout="this.size=1;" runat="server">

</asp:DropDownList>


Thanks,
Debata

Chvrsri, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chvrsri on: 5/27/2011 [Member] [Moderator] [MVP] Silver | Points: 25

Up
0
Down
Hi
what you have provided is working fine, but we need to add onclick="this.size=1;" in order to produce selected value on top.

thanks for your help.

Thanks,
Radha Srikanth

Chvrsri, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response