I have a grid with a foreign key that is displaying a dropdown in in-line edit mode. That's working fine but I would like to display multiple columns from the parent object in that dropdown not just the key as it currently does. How do I configure for that?
Here's what I have
@(Html.Kendo().Grid<MBSData.Model.DocumentType>()
.Name("documenttypegrid")
.HtmlAttributes(new {style = "height:600px;"})
.Columns(columns =>
{
columns.Bound(c => c.DocumentTypeId).Title("Type").Width("120px");
columns.ForeignKey(p => p.DocumentCategoryId, (System.Collections.IEnumerable) ViewData["DocumentCategories"], "DocumentCategoryId", "DocumentCategoryId")
.Title("Category")
.Width("120px");
columns.Bound(c => c.Description);
columns.Command(command =>
{
command.Edit();
command.Destroy();
}).Width("190px");
})
.ToolBar(toolbar => { toolbar.Create(); })
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Sortable(sortable => { sortable.SortMode(GridSortMode.MultipleColumn); })
.Filterable()
.Scrollable(s => s.Height("auto"))
.Resizable(resize => resize.Columns(true))
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
.Model(model => model.Id(p => p.DocumentTypeId))
.Read(read => read.Action("DocumentType_Read", "DocumentType"))
.Create(create => create.Action("DocumentType_Create", "DocumentType"))
.Update(update => update.Action("DocumentType_Update", "DocumentType"))
.Destroy(destroy => destroy.Action("DocumentType_Destroy", "DocumentType"))
)
.Events(events => events
.Edit("onEdit")
)
)
Thanks.
Tom