简体   繁体   中英

How to set a width to a Kendo UI Autocomplete control

I am using the kendo ui autocomplete control inside a div. I set the styles for the div but it didn't work for me.

<div>

@(Html.Kendo().AutoComplete()
.Name("NameAutoComplete") 
.DataTextField("FullName") 
.BindTo(Model.NameList)  
.Filter("contains") 
)

</div>

Thank you.

Indeed the easiest way is to do it through the HtmlAttributes method.

eg

@(Html.Kendo().AutoComplete().Name("test").HtmlAttributes(new { style="width:400px"}))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM