I have a custom popup grid editor (which is a partial view). Model is always null in the editor so I cannot access the Model to key off values.
I have a datasource for this dropdown list as you can see below. I need to add a userId parameter to this datasource when in edit mode. Unfortunately I have not been able to figure out how to get that value since Model is null.
Any tricks I can do here?
<div class="editor-container">
<div class="row">
<div class="col">
@Html.LabelFor(m => m.UserId)
@(Html.Kendo().DropDownListFor(m => m.UserId)
.OptionLabel("Select..")
.DataTextField("Text")
.DataValueField("Value")
.DataSource(dataSource => {
dataSource.Custom()
.Type("aspnetmvc-ajax")
.Transport(transport => transport.Read("Global_SalesUsers_DropDown", "Company", new {companyId = companyId}))
.Schema(schema => schema.Data("Data"))
.Events(events => events.RequestEnd("processViewDataResponse"));
})
)
@Html.ValidationMessageFor(m => m.UserId)
</div>
</div>