@{
    ViewBag.Title = "Home Page";
}

<div class="row">
    <div class="col-12">
        @(Html.Kendo().Grid<TelerikMvcApp3.Models.OrderViewModel>()
            .Name("grid")
            .Columns(columns =>
            {
                columns.Bound(p => p.OrderID).Filterable(false);
                columns.Bound(p => p.Freight);
                columns.Bound(p => p.OrderDate).Format("{0:MM/dd/yyyy}");
                columns.Bound(p => p.ShipName);
                columns.Bound(p => p.ShipCity);
                columns.Bound(p => p.VehicleType).ClientTemplate("#=VehicleType.VehicleTypeName#").Sortable(false);
            })
            .Pageable()
            .Sortable()
            .Scrollable()
            .Filterable()
            .Editable(e => e.Mode(GridEditMode.InCell))
            .HtmlAttributes(new { style = "height:550px;" })
            .DataSource(dataSource => dataSource
                .Ajax()
                .PageSize(20)
                .Model(m => m.Id(o => o.OrderID))
                .Read(read => read.Action("Orders_Read", "Grid"))
                .Update(u => u.Action("Update", "Grid"))
            )
        )
    </div>
</div>