Items in a dropdownlist control

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?aUhhdkFRdWVzdGlvbg==?=

    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.
  • =?Utf-8?B?TWFuaXNo?=

    #2
    RE: Items in a dropdownlist control

    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.EventArg s) Handles Me.Load
    Me.DropDownList 1.Attributes.Ad d("size", "5")
    End Sub

    Regards,
    Manish
    MESCIUS USA Inc. has JavaScript and .NET UI controls, datagrids, reporting solutions, spreadsheets, document APIs and more to take your applications further.


    "iHavAQuest ion" 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.

    Comment

    Working...