or
@(Html.Kendo().Grid<MyProject.ViewModels.Calculation.WorkGridItem>() .Name("grid") .BindTo(Model.WorkGrid.WorkGridItems) .Columns(c => { c.Bound(i => i.Identifier).Title("Id"); c.Bound(i => i.Name).Title("Namn"); c.Bound(i => i.City).Title("Stad"); c.Bound(i => i.Status).Title("Status"); c.Bound(i => i.StartDate).Title("Start"); c.Bound(i => i.EndDate).Title("Slut"); c.Bound(i => i.Created).Title("Skapad"); c.Bound(i => i.SigningDate).Title("Signatur"); }) .ClientDetailTemplateId("expandedRowTemplate") .Events(l => l.DetailInit("OnLoadDetail")) .Events(ev => ev.DetailExpand("detailExpand")) .Pageable(x => { x.PageSizes(new int[] { 50, 100, 200 }); x.Refresh(true); }) .Sortable(x => x.Enabled(true)) .DataSource(ds => ds. Ajax() .ServerOperation(true) .Read(read => read .Action("ReadGridItems", "Calculations", new { selectedTab = Model.Tabs.SelectedTab().Value, gridType = Model.PageHeaderSearch.SelectedSearchType, searchString = Model.PageHeaderSearch.SearchWord, }) .Type(HttpVerbs.Post) ) .PageSize(50)<div> @(Html.Kendo().Grid(Model) .Name("Grid") .Columns(columns => { columns.Bound(p => p.Id); columns.Bound(p => p.UserName); columns.Bound(p => p.FullName); columns.Bound(p => p.Organization).ClientTemplate( "# if (data.Organization != null) { #" + "#= data.Organization.Name #" + "# } else { #" + "#: '<N/A>' #" + "# } #" ) .Filterable(filterable => filterable.UI("orgFilterKendo")); columns.Bound(p => p.Email); columns.Bound(p => p.PhoneNumber); columns.Bound(p => p.PostName); }) .Filterable(filterable => filterable .Extra(true) ) .EnableCustomBinding(true) .DataSource(dataSource => dataSource .Ajax() .Model(model => { model.Id(p => p.Id); model.Field(p => p.Id).Editable(false); }) .Read("GetGridData", "User") ) )</div><script id="orgFilterKendo" type="text/x-kendo-template"> @Html.Kendo().DropDownListFor( @(Html.Kendo().DropDownList() .Name("Organization") .DataValueField("Id") .DataTextField("Name") .OptionLabel("Не задано") .BindTo((System.Collections.IEnumerable)ViewData["UserOrganizations"]) .ToClientTemplate())</script><script type="text/javascript"> function orgFilterKendo(element) { element.kendoDropDownList({ dataTextField: "Name", dataValueField: "Id", optionLabel: "--Select Value--", dataSource: { transport: { read: "@Url.Action("FilterMenu_Organizations")" } } }); } </script>.DataSource(dataSource => dataSource .Ajax() .Model(model => { model.Id(g => g.id); model.Field(g => g.id).Editable(false); model.Field(g => g.user_id); model.Field(g => g.group_id); }) .Create(c => c.Url("http://localhost:808/api/UserGroup").Type(HttpVerbs.Post)) .Update(update => update.Url("http://localhost:808/api/UserGroup").Type(HttpVerbs.Put)) .Destroy(destroy => destroy.Url("http://localhost:808/api/UserGroup").Type(HttpVerbs.Delete)) )OPTIONS http://localhost:808/api/UserGroup 405 (Method Not Allowed) jquery.min.js:2OPTIONS http://localhost:808/api/UserGroup 405 (Method Not Allowed) jquery.min.js:2DELETE http://localhost:808/api/UserGroup 404 (Not Found) UserGroup:1XHR finished loading: "http://localhost:808/api/UserGroup".columns.Command(commands =>{ commands.Edit(); @<text> @if (!item.IsStartPage) { commands.Destroy(); } </text>;})columns.Command(commands =>{ commands.Edit(); commands.Destroy(!item.IsStartPage);})public class ReportMonthTotals{ public string Month { get; set; } public int Year { get; set; } public decimal Total { get; set; }}1 2013 1200.0012 2012 1350.0011 2012 1100.0010 2012 1050.00@(Html.Kendo().Chart<Reporting.Data.SalesModel.ReportMonthTotals>() .Name("salesChart") .Title("Sales") .Legend(legend => legend .Position(ChartLegendPosition.Bottom) ) .Series(series => { series.Line(m => m.Total); }) .ValueAxis(axis => axis.Numeric() .Labels(labels => labels .Format("${0}") ) ) .CategoryAxis(axis => axis .Categories(m => m.Month) ) .DataSource(dataSource => dataSource .Read(read => read.Action("Sales_Read", "Sales")
.Group(group => group.Add(m => m.Year))
))public ActionResult Sales_Read([DataSourceRequest] DataSourceRequest request){ return Json(SalesModel.GetSales(), JsonRequestBehavior.AllowGet);}