I'm trying to use the same DropDownList widget multiple times within a loop in form for however many fleets a manager is assigned as shown in the attachment. The first instance of the DropDownList displays correctly. After that it displays as a text box with the value, not the text. And no dropdown.
Here's the code I used for the widget.
@(Html.Kendo().DropDownListFor(m => m.ManagerViewModel.ManagerId)
.Name("ManagerDropDownList")
.DataTextField("ManagerNameLast")
.DataValueField("ManagerId")
.HtmlAttributes(new { style = "width: 200px;" })
.BindTo(Model.MgrsDropdownViewModel)
)
And here is the page source for the first and second instances. The complete list of managers is shown for both instances. But the data-val properties are missing in the second instance. How do I get the data-val to show for every instance?
<input data-val="true" data-val-number="The field ManagerId must be a number." data-val-required="The ManagerId field is 
required." id="ManagerDropDownList" name="ManagerDropDownList" style="width: 200px;" type="text" value="80" /><script>
jQuery(function(){jQuery("#ManagerDropDownList").kendoDropDownList({"dataSource":[{"ManagerId":280,"ManagerNameLast":"AXXXXXXO, JOHN "},
<input id="ManagerDropDownList" name="ManagerDropDownList" style="width: 200px;" type="text" value="80" /><script>
jQuery(function(){jQuery("#ManagerDropDownList").kendoDropDownList({"dataSource":[{"ManagerId":280,"ManagerNameLast":"AXXXXXXO , JOHN "},
Here's the code I used for the widget.
@(Html.Kendo().DropDownListFor(m => m.ManagerViewModel.ManagerId)
.Name("ManagerDropDownList")
.DataTextField("ManagerNameLast")
.DataValueField("ManagerId")
.HtmlAttributes(new { style = "width: 200px;" })
.BindTo(Model.MgrsDropdownViewModel)
)
And here is the page source for the first and second instances. The complete list of managers is shown for both instances. But the data-val properties are missing in the second instance. How do I get the data-val to show for every instance?
<input data-val="true" data-val-number="The field ManagerId must be a number." data-val-required="The ManagerId field is 
required." id="ManagerDropDownList" name="ManagerDropDownList" style="width: 200px;" type="text" value="80" /><script>
jQuery(function(){jQuery("#ManagerDropDownList").kendoDropDownList({"dataSource":[{"ManagerId":280,"ManagerNameLast":"AXXXXXXO, JOHN "},
<input id="ManagerDropDownList" name="ManagerDropDownList" style="width: 200px;" type="text" value="80" /><script>
jQuery(function(){jQuery("#ManagerDropDownList").kendoDropDownList({"dataSource":[{"ManagerId":280,"ManagerNameLast":"AXXXXXXO , JOHN "},