or
var accountSearchDataSource = new kendo.data.DataSource({ transport: { read: { url: function () { if (selectedPortfolioId) { return UrlLibrary.FetchAccountsByPortfolioId + '/' + selectedPortfolioId; } else { return null; } }, dataType: 'json' } }, pageSize: 10, group: [{ field: "CountryCode" }, { field: "AccountNumber" }, { field: "ProductType"}] }); $('#accountSearchResultsGrid').kendoGrid({ dataSource: accountSearchDataSource, selectable: "row", pageable: true, height: 500, columns: [ { field: 'AccountNumber', title: 'Account Number' }, { field: 'ProviderName', title: 'Provider Name' }, { field: 'ProductName', title: 'Product Name' }, { field: 'ProductType', title: 'Product Type', width: 80 }, { field: 'PriceClass', title: 'Price Class', template: function (e) { if (!e.PriceClass) { return ''; } else { return e.PriceClass; } } }, { field: 'ClientFee', title: 'Default Fee', template: function (e) { if (e.ClientFee == false) { return 'Yes'; } else { return 'No'; } }, width: 70 }, { field: 'ClientFee', title: 'Client Fee', template: function (e) { if (e.ClientFee == true) { return 'Yes'; } else { return 'No'; } }, width: 70 }, { field: 'Approved', title: 'Approved', template: function (e) { if (e.ClientFee != null) { if (e.Approved == true) { return '<input type="checkbox" name="approved" checked="checked" disabled="disabled" />'; } else { return '<input type="checkbox" name="approved" id="approved' + e.ProductId + '" />'; } } else { return '<input type="checkbox" name="approved" disabled="disabled" />'; } }, width: 70 }] });
@model List<Biblioteka.ViewModels.BookViewModel>@{ ViewBag.Title = "Index";}<h2>Index</h2>@(Html.Kendo().Grid<Biblioteka.ViewModels.BookViewModel>() .Name("BooksKendoGrid") .Columns(columns => { columns.Bound(p => p.Title); columns.Bound(p => p.Author); columns.Bound(p => p.BookGenreId); columns.Bound(p => p.ReleaseDate); columns.Bound(p => p.ISBN); columns.Bound(p => p.Count); columns.Bound(p => p.RealBookCount); columns.Bound(p => p.AddDate); columns.Bound(p => p.ModifiedDate); columns.Bound(p => p.BookId).Width(50).ClientTemplate("Some HTML code"); //columns.Command(command => { command.Edit(); }).Width(200); }) //.ToolBar(toolbar => toolbar.Create()) // PopUp editing Mode .Editable(editable => editable.TemplateName("BooksEditor").Mode(GridEditMode.PopUp)) .Pageable() .Sortable() .Scrollable() .Filterable() .DataSource(dataSource => dataSource .Ajax() .ServerOperation(false) .Model(model => { //The unique identifier (primary key) of the model is the ProductID property model.Id(p => p.BookId); }) // .Create(create => create.Action("Create", "Books")) .Read(read => read.Action("BooksKendoGridRead", "Books").Type(HttpVerbs.Post) ) ).BindTo(Model) )