471,046 Members | 1,293 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,046 software developers and data experts.

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 1192
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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.