KendoUI设置下拉列表的宽度

DSh*_*ltz 5 razor asp.net-mvc-4 kendo-ui

我正在寻找设置KendoUI下拉列表宽度的最佳方法 - 通过Kendo HTML Helper.

@(Html.Kendo().DropDownList()
    .Name("ddlAccount")
    .DataTextField("Name")
    .DataValueField("Id")
    //This doesn't work, it styles the hidden input instead of the ddl
    .HtmlAttributes(new {style="width:200px;"})
)
Run Code Online (Sandbox Code Playgroud)

我正在设置DropDownList的宽度,但是在生成的HTML中注意,在隐藏文本输入上设置了200像素的宽度,而不是下拉列表:

<span aria-busy="false" aria-readonly="false" aria-disabled="false" aria-owns="ddlAccount_listbox" tabindex="0" aria-expanded="false" aria-haspopup="true" role="listbox" class="k-widget k-dropdown k-header styled_select" style="" unselectable="on" aria-activedescendant="ddlAccount_option_selected">

<span class="k-dropdown-wrap k-state-default">
    <span class="k-input">Choice One</span>
    <span class="k-select">
        <span class="k-icon k-i-arrow-s">select</span>
    </span>
</span>
<input id="ddlAccount" name="ddlAccount" style="width: 200px; display: none;" type="text" data-role="dropdownlist">
Run Code Online (Sandbox Code Playgroud)

...所以生成的DropDownList仍然水平和垂直滚动,这是我不想要的.

小智 13

@Html.Kendo().DropDownList().HtmlAttributes(new { style = "width:300px" })在服务器端为我工作并在http://docs.kendoui.c​​om/上记录.可能不会这么久.