Friday, 9 August 2013

Bind Kendoui dropdownlist to mvvm data-bind value

Bind Kendoui dropdownlist to mvvm data-bind value

How do i data-bind the MVVM value to my dropdownlist? The input element
below works well
<input class="k-textbox" placeholder="hotel business registration"
required data-bind="value: dataItem.HotelStatusId"/>
I doesn't when i try to use KendoUI dropdownlist instead
@Html.Kendo().DropDownList().BindTo(new SelectList(ViewBag.HotelStatuses,
"Id",
"Name")).Value("#=dataItem.HotelStatusId#").Name("ddl-hotel-status");
this does not work either
@Html.Kendo().DropDownList().BindTo(new SelectList(ViewBag.HotelStatuses,
"Id", "Name")).Value("dataItem.HotelStatusId").Name("ddl-hotel-status");

No comments:

Post a Comment