, , ...
, , jQuery css.
: comboBox, DropdownList
,
@(Html.Kendo().ComboBoxFor(m => m.UserId)
...
.HtmlAttributes(new { @class = "wideList" })
)
Then add a Javascript snippet that does this:
$(document).ready(function () {
$("input[data-role=\"combobox\"].wideList").each(function () {
var combo = $(this).data("kendoComboBox");
combo.list.width(400);
});
});
To take another step, you could make it more general by specifying the width when defining the drop-down list:
@(Html.Kendo().ComboBoxFor(m => m.UserId)
...
.HtmlAttributes(new { @class = "wideList", listWidth = "400" })
)
Then more general javascript:
$(document).ready(function () {
$("input[data-role=\"combobox\"].wideList").each(function () {
var combo = $(this).data("kendoComboBox");
var width = $(this).attr('listWidth');
combo.list.width(width);
});
});
source
share