This is partial view:
@model DMDPace.DataAccess.DomainModels.Department
@(Html.Kendo().DropDownListFor(m => m)
.DataTextField("Name")
.DataValueField("Id")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetDepartments", "Home");
});
})
)
That's how I reference it:
<div><partial model="@Model.Department" name="Selectors/Department"/></div>
Would you try to set the nested Model property to which the DropDownList should bind?
For example:
Also, if you remove the DropDownList, does the Partial View load?
I tried to set property, and it appeared, but everything is incorrect. DropDownList appeared in incorrect DOM tree place, input appeared in correct, but it's not hidden and has incorrect id and name attribute's values. Correct are Department, actual are Id.
I got it rendering correctly, writing partial view this way:
@model DMDPace.DataAccess.DomainModels.User @(Html.Kendo().DropDownListFor(m => m.Department) .DataTextField("Name") .DataValueField("Id") .DataSource(source => { source.Read(read => { read.Action("GetDepartments", "Home"); }); }) )
And using this way:
<partial model="@Model" name="Selectors/Department"/>
But input will have id and name attributes equal Department, which is incorrect, that's need to be DepartmentId. Also, for some reason it doesn't Department's current value, it displays first value of collection returned from the server's endpoint.
I have prepared a demo project based on your scenario. You can find it attached.
Would you please modify it with your code to reproduce the behavior you are experiencing and send it back to me to review it?
Thank you for your cooperation.