Items in a dropdownlist control

I

iHavAQuestion

I have a dropdownlist of width 100px in a webform.
When I hit the control, I gets the list of items that I populated in a
pageload.

My problem is that the items in my dropdown are more in length then a
dropdownlist control
I want to keep the drop down the same length as it is and when I hit the
dropdownlist i should let the user to see the full length in an item.
I would also want to display only 5 items when I hit the drop down allowing
the scrollable bar displayed at the right.

Can any one please help me out.
 
M

Manish

Hi,

You can try the following code to show five items in your DropDownList and
then enable the Scrollbars in the ddl. As far as width of the items is
concerned, I think the Items width can be same as your ddl width.

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Me.DropDownList1.Attributes.Add("size", "5")
End Sub

Regards,
Manish
www.Componentone.com
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top