or
var grid = $("#grid").kendoGrid({ dataSource: { data: [ {foo: 10, bar: "A", total: 0}, {foo: 20, bar: "B", total: 0}, {foo: 5, bar: "B", total: 0}, {foo: 35, bar: "A", total: 0} ], schema: { model: { fields: { foo: { type: "number" }, bar: { type: "string" }, total: { type: "number" } } } }, aggregate: [ {field: "foo", aggregate: "sum"}, {field: "foo", aggregate: "average"} ], change: function(e) { var item = e.items[0]; if (this.group().length && e.action !== "itemchange") { item = getFirstItem(item); } console.log("Total Foo: "); console.log("Total Foo of bar A: "); console.log("Total Foo of bar B: "); console.log("Total Foo of bar C: "); } }, //groupable: true, editable: true, toolbar: ["create", "save", "cancel"], columns: [ { field: "foo", footerTemplate: "Sum1: #= sum # || Average: #= average #" }, { field: "bar" }, { field: "total" } ] }).data("kendoGrid");@(Html.Kendo().Chart() .Name("KendoChart") .Title(title => title.Text("Data Chart")) .Series(s => { s.Line(new int[] { 91, 95, 99, 93, 98, 98, 97, 100 }).Color("blue").Width(4.0); }) .CategoryAxis(catAxis => catAxis.Categories(new string[] { "July", "August", "September", "October", "November", "December", "January", "February"})) )$.ajax({ url: .../getViewModel/, dataType: "json", success: function (JsonResult) { ... $("#grid").data("kendoGrid").dataSource.data(JsonResult.GridResults.GridData); ... } ...}$("#grid").data("kendoGrid").dataSource.data(JsonResult. GridResults.GridData); //ok$("# grid ").data("kendoGrid").dataSource.total(JsonResult.GridResults.GridTotalRecordCount); // do not worksvar grid = $("#grid").data("kendoGrid"); // okvar newDS = new kendo.data.DataSource({ data: JsonResult.GridResults.GridData , total: JsonResult.GridResults.GridTotalRecordCount}); grid.setDataSource(newDS);