This is a migrated thread and some comments may be shown as answers.

Auto width Combobox displays horizantal scroll on popup

1 Answer 63 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jatin
Top achievements
Rank 1
Jatin asked on 26 Jul 2011, 08:43 AM
Hi,
   I was trying to use Dropdown list with its width auto so that it fits the item that it is displaying. For that I removed the width of the css class 
.t-combobox,
.t-dropdown,
.t-selectbox
{
/*    width: 150px;  Removed */
....
}

It now calculates the width according to the selected item. However, the popup that appears when selecting another item from the list shows up horizontal scroll bar (if one of the items in list has width greater than the selected item). Is there a way to increase the width of the popup to fit to the largest item in the list, thus avoiding horizontal scrollbar.

regards,
Nirvan. 

1 Answer, 1 is accepted

Sort by
0
David
Top achievements
Rank 1
answered on 07 Oct 2011, 09:56 PM
I was able to get the popup portion of the Combobox to auto size using the DropDownHtmlAttributes method when creating the Combobox.
@Html.Telerik().DropDownList().Name("MyDropdown").BindTo(new SelectList(ViewBag.ListOfStuff, "Id", "Name")).DropDownHtmlAttributes(new { style = "width:auto;" })


-David Paquette
Tags
ComboBox
Asked by
Jatin
Top achievements
Rank 1
Answers by
David
Top achievements
Rank 1
Share this question
or