2

Im trying to do a CRUD in Kendo Detail template but when I add the command columns or the add command in the toolbar of the detail grid I get an exception.

I need to know how to add this command buttons in the detail grid with out getting error.

Here is my detail Grid:

<script id="detailTemplate" type="text/kendo-tmpl">
    @(Html.Kendo().Grid<CarModel>()
    .Name("grid_#=ID#") 
    .HtmlAttributes(new { style = "width: 1200px;" })
    .Columns(columns =>
    {
        columns.Bound(c => c.ID).Width(200);
        columns.Bound(c => c.Brand).Width(200);
        columns.Command(command =>
        {
            command.Edit().UpdateText("Update").CancelText("Cancel").Text("Update");
            command.Custom("Delete").Click("delete");
        }).Width(244);
    })
    .ToolBar(toolbar => toolbar.Create().Text("Add"))
    .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(5)
        .Events(events => events.Error("error"))
        .Events(events => events.RequestEnd("request"))
        .Model(model =>
        {
            model.Id(c => c.ID);
        })
        .Read(read => read.Action("getCars", "Car"))
        .Create(create => create.Action("CreateCar", "Car"))
        .Update(update => update.Action("UpdateCar", "Car"))
        .Destroy(destroy => destroy.Action("DeleteCar", "Car"))
    )
    .Pageable()
    .Sortable()
    .ToClientTemplate()
    )
</script>
Leo Alfaro
  • 21
  • 1

0 Answers0