I have an MVC 3 project where I pretty often use the Kendo UI grid.
A typical view is as follows:
@using Kendo.Mvc.UI
@model List<ActionViewModel>
@(Html.Kendo().Grid<ActionViewModel>()
.Name("#grid")
.Columns(columns =>
{
columns.Bound(p => p.Name);
columns.Command(command => { command.Edit(); command.Destroy(); });
})
.ToolBar(toolbar => toolbar.Create().Text(Resources.Grid.Create))
.Editable(editable => editable.Mode(GridEditMode.PopUp)))
.Sortable()
.Scrollable()
.Filterable(f=>f.Extra(true))
.DataSource(dataSource => dataSource
.Ajax()
.Events(events => events.Error("error_handler"))
.Model(model => model.Id(p => p.Id))
.Create(update => update.Action("Create", "Action"))
.Read(read => read.Action("Read", "Action"))
.Update(update => update.Action("Update", "Action"))
.Destroy(update => update.Action("Delete", "Action"))
))
I often have to define my own editor templates for my view models, they are used in the Kendo UI edit popup menu.
In the Kendo UI grid, you can create, update, and delete items. The popup window for editing and creation uses the same editor template by default. Is there an easy way to have two separate editor templates for editing and deleting?
source
share