Items in a dropdownlist control

  • Thread starter Thread starter iHavAQuestion
  • Start date Start date
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.
 
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
 
Back
Top