In this other answer, the view’s model is being passed to the EditorViewData.
In my case the view has master data and the grid represents detail data, so my DDL options are populated in the Grid’s view model, not the page view model. How can you reference the grid’s view model?
My Page level view model:
@model OTIS.AppServ.InventoryMgmt.ViewModels.POHeaderViewModel
My Grid’s view model definition:
@(Html.Kendo().Grid<OTIS.AppServ.InventoryMgmt.ViewModels.PODetailViewModel>()
How to pass this grid’s view model to EditorViewData, i.e.
columns.Bound(l => l.CustomerId)
.EditorViewData(new { Options = PODetailViewModel.CustomerOptions });
or
columns.Bound(l => l.CustomerId)
.EditorViewData(new { Options = "#= CustomerOptions #" });
Neither of these worked of course…but hopefully you can see what I am trying to do.
After thinking about it, this is not the route I’d go as you’d be repeating the DDLoptions in each detail row. As such it is better to just have the ddl source come from the page level view model or viewdata.