Have a Grid.cshtml page which has one dropdown which is defined by a EditorTemplateName named ValueViewTemplate.cshtml (below).... Would like to add more dropdowns to the Grid.cshmtl. Currently seems like have to add more EditorTemplateName templates for each dropdown. Is there way to pass in the ViewData to the EditorTemplateName function so don't have to define a editor template for each dropdown?
Also current pages seems to work for InCell and InLine... Is there way to make it work for Popup for does there need to be additional templates defined for the Popup option for editable mode...
Grid.cshtml
@(Html.Kendo().Grid<NEP_Deconstruction.Data.Models.ApprovalViewModel>()
.Name("approval_grid")
.Columns(columns =>
{
columns.Bound(o => o.ApprovalNumber);
columns.Bound(o => o.ApprovalName);
columns.Bound(o => o.Comment);
columns.ForeignKey(o => o.ApprovalCountryID, (System.Collections.IEnumerable)ViewData["ApprovalCountry"], "ID", "Value")
.EditorTemplateName("ValueViewTemplate");
columns.Bound(o => o.EffectiveDate);
columns.Command(command => { command.Edit(); command.Destroy(); }).Width(210);
})
.ToolBar(toolbar => toolbar.Create())
.Editable(editable => editable.Mode(GridEditMode.InLine))
ValueViewTemplate.cshtml
@model NEP_Deconstruction.Data.Models.ValueViewModel
@(Html.Kendo().DropDownListFor(m => m)
.DataValueField("ID")
.DataTextField("Value")
.BindTo((System.Collections.IEnumerable)ViewData["ApprovalCountry"])
)