|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
asp:dropdown list widthIs there a way to change the width of the dropdown list width? I don't want
to change the width of the dropdown control. This needs to be fixed width. I only want to adjust the size of the drop down list of a combo box to fit the size of the longest string in its items. How do I do this for asp:dropdown control. thanks. Just use the CSS width property. The DropDownList automatically expands to
the width of the longest ListItem unless otherwise specified, so normally you won't even need to do this. Am I somehow misunderstanding what you are really trying to do? Good Luck! Show quoteHide quote "rum23" <ru***@discussions.microsoft.com> wrote in message news:0E711C83-9063-497F-86C9-7124161E2DBE@microsoft.com... > > Is there a way to change the width of the dropdown list width? I don't > want > to change the width of the dropdown control. This needs to be fixed width. > I > only want to adjust the size of the drop down list of a combo box to fit > the > size of the longest string in its items. How do I do this for asp:dropdown > control. > > thanks. thank you for responding, but this is not what I'm looking for.
I have to keep the widht of the combox box to a fixed width. I don't want to change this fixed width at any time due to real estate on the page. I want to increase the width of the List (this is the list that displays when you click on the down arrow in the combo box). I want the width of this list to be set to the longest item width. In windows form, you can do this by simply setting the "ListWidth" property for a comobox and I'm looking for something similar in asp web controls. Please let me know if my question is not clear. Thanks much. Show quoteHide quote "Nathan Sokalski" wrote: > Just use the CSS width property. The DropDownList automatically expands to > the width of the longest ListItem unless otherwise specified, so normally > you won't even need to do this. Am I somehow misunderstanding what you are > really trying to do? Good Luck! > -- > Nathan Sokalski > njsokal***@hotmail.com > http://www.nathansokalski.com/ > > "rum23" <ru***@discussions.microsoft.com> wrote in message > news:0E711C83-9063-497F-86C9-7124161E2DBE@microsoft.com... > > > > Is there a way to change the width of the dropdown list width? I don't > > want > > to change the width of the dropdown control. This needs to be fixed width. > > I > > only want to adjust the size of the drop down list of a combo box to fit > > the > > size of the longest string in its items. How do I do this for asp:dropdown > > control. > > > > thanks. > > > Hi there
If you want to make the dropdown more width, that the field that shows the selected item. Then you need to build the control your self. The <select> will not do that for you. Instead you have to make some good old DHTML. with an <input type=text readonly>, that shows you the selected item. Then have a button with the downarrow. This button must take the click event in javascript, and on click show a <select> with multiple rows eg. 6 or 10 or what you deside. When mouse moves out of this control, hide it.. if user selects an item, then copy the item to the input field, and hide the control. Hope you get the idea. In this way, you can have differente style for <input> field, that shows the selected value, and the <select> which only is visible, when the button is clicked. Best regards and happy coding. Brian Kenneth Nielsen http://www.bknnet.dk/ rum23 wrote: Show quoteHide quote > thank you for responding, but this is not what I'm looking for. > > I have to keep the widht of the combox box to a fixed width. I don't want to > change this fixed width at any time due to real estate on the page. > > I want to increase the width of the List (this is the list that displays > when you click on the down arrow in the combo box). I want the width of this > list to be set to the longest item width. > > In windows form, you can do this by simply setting the "ListWidth" property > for a comobox and I'm looking for something similar in asp web controls. > > Please let me know if my question is not clear. Thanks much. > > "Nathan Sokalski" wrote: > >> Just use the CSS width property. The DropDownList automatically expands to >> the width of the longest ListItem unless otherwise specified, so normally >> you won't even need to do this. Am I somehow misunderstanding what you are >> really trying to do? Good Luck! >> -- >> Nathan Sokalski >> njsokal***@hotmail.com >> http://www.nathansokalski.com/ >> >> "rum23" <ru***@discussions.microsoft.com> wrote in message >> news:0E711C83-9063-497F-86C9-7124161E2DBE@microsoft.com... >>> Is there a way to change the width of the dropdown list width? I don't >>> want >>> to change the width of the dropdown control. This needs to be fixed width. >>> I >>> only want to adjust the size of the drop down list of a combo box to fit >>> the >>> size of the longest string in its items. How do I do this for asp:dropdown >>> control. >>> >>> thanks. >> >>
asp button always rendered as type="button" vs. type="submit"
GridView w/ ITemplate Columns - Can't find data on Postback CreateUserWizard Control question Multiple controls with the same ID Upload multiple files DynamicItemTemplate not applied on programmatically added Menu Items Re: How to Reference Gridview child controls Reportviewer not showing any data visual clue for PopulateOnDemand validation within createuserwizard |
|||||||||||||||||||||||