I have a Kendo DropDownList, but strangely enough I can not set its initial value.
Html.Kendo().DropDownList()
.Name("PersonalCoachName")
.BindTo(new SelectList((List<string>)ViewData["coachResources"]))
.HtmlAttributes(new { style = "font-size:8pt;" })
ViewData["coachResources"] is a List of string type. Regardless I use
.BindTo(new SelectList((List<string>)ViewData["coachResources"], "Default"))
or
.SelectedIndex(3)
DropDownList does not change it value and only display the 1st value in the list. I need help on this. Thanks.
The value works only in jquery, not in html helper. So it works in Jquery like
var dropdownlist = $("#PersonalCoachName").data("kendoDropDownList");
dropdownlist.value(coachId);
dropdownlist.refresh();