468,290 Members | 2,024 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,290 developers. It's quick & easy.

Items in a dropdownlist control

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.
Jun 27 '08 #1
1 1146
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

"iHavAQuestion" wrote:
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.
Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Michael | last post: by
2 posts views Thread by MrBee | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.