4
votes

I have created a Kendo Grid in MVC using Razor syntaxes & able to do Inline Editing in that like,

   @(Html.Kendo().Grid<Invoice.Models.ViewModels.SegmentViewModel>()
    .Name("Segment")
            .TableHtmlAttributes(new { style = "height:20px; " })
                    //.TableHtmlAttributes(new { style:"height:30px;"})
    .Columns(columns =>
    {
        columns.Bound(p => p.Airline).ClientTemplate("#=Airline.AirlineName#").Width(5);
        columns.Bound(p => p.Departs).Width(5);
        columns.Bound(p => p.DepartureDate).Width(9);
        columns.Bound(p => p.Arrives).Width(5);
        columns.Bound(p => p.ArrivalDate).Width(7).Format("{0:d}");
    })
    .Editable(editable => editable.Mode(GridEditMode.InCell))
    .Navigatable()
    .DataSource(dataSource => dataSource
        .Ajax()
        .Batch(true)
        .ServerOperation(false)
        .Events(events => events.Error("error_handler"))
        .Model(model => model.Id(p => p.Airline))
        .Create("Editing_Create", "Grid")
        .Read("Segment_Read", "Document")
        .Update("Editing_Update", "Grid")
        .Destroy("Editing_Destroy", "Grid")
    )
            )

But how to define the Client Template "Airline.AirlineName" which I am using for Dropdown.

Please suggest me something to do in this.

1

1 Answers

2
votes

Check the MVC offline version of the following demo. (you can see the editor template there).

The documentation explains the same here.