Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kendo dropdown width

Hi can someone tell me how to set width for kendo dropdown? Here is my code sample and it is not working. Anything wrong in that?

$("#div1").kendoDropDownList({
    dataSource: items,
    dataTextField: "Name",
    dataValueField: "Id",
    Width : "250px"
});
like image 825
jestges Avatar asked Apr 18 '13 03:04

jestges


People also ask

How do I change the width of a kendo Dropdownlist?

$("#div1"). kendoDropDownList({ dataSource: items, dataTextField: "Name", dataValueField: "Id", Width : "250px" }); kendo-ui.

How do I style a kendo Dropdownlist?

k-list-container and . k-list-scroller ) to Dropdownlist using JavaScript. And make the height of ". k-list-scroller" dynamic i.e. the drop down list-area when selected, the height of it, should go beyond screen height or window height.


1 Answers

If MVC Razor DropDownList HTML helper/wrapper syntax is applied, then you can use method HtmlAttributes to specify the width of dropdown list like:

 @(Html.Kendo().DropDownList()                                                            .Name("myDDL")
.HtmlAttributes(new { style="width:100px" })
like image 73
Thomas.Benz Avatar answered Oct 21 '22 20:10

Thomas.Benz