Your search did not match any results.

Web API Service

The PivotGrid can communicate with a Web API service. The quantity of aggregated data is irrelevant when aggregation is performed on the server. For example, the widget works with a million aggregated records in this demo.

To configure access to a Web API service from the client, use the createStore method, which is part of the DevExtreme.AspNet.Data extension. This extension also allows you to configure server-side data processing for DevExtreme widgets.

You should also set the remoteOperations option to true to notify the PivotGrid that data is aggregated on the server.

@(Html.DevExtreme().PivotGrid() .AllowSorting(true) .AllowSortingBySummary(true) .AllowFiltering(true) .Height(620) .ShowBorders(true) .RowHeaderLayout(PivotGridRowHeadersLayout.Tree) .Scrolling(e => e.Mode(PivotGridScrollingMode.Virtual)) .DataSource(d => d .RemoteOperations(true) .Store(s => s.RemoteController() .Key("OrderID") .LoadUrl("https://js.devexpress.com/Demos/WidgetsGalleryDataService/api/Sales/Orders") ) .Fields(fields => { fields.Add() .Caption("Category") .DataField("ProductCategoryName") .Width(250) .SortBySummaryField("SalesAmount") .SortBySummaryPath(new string[0]) .SortOrder(SortOrder.Desc) .Expanded(true) .Area(PivotGridArea.Row); fields.Add() .Caption("Subcategory") .DataField("ProductSubcategoryName") .Width(250) .SortBySummaryField("SalesAmount") .SortBySummaryPath(new string[0]) .SortOrder(SortOrder.Desc) .Area(PivotGridArea.Row); fields.Add() .Caption("Product") .DataField("ProductName") .Width(250) .SortBySummaryField("SalesAmount") .SortBySummaryPath(new string[0]) .SortOrder(SortOrder.Desc) .Area(PivotGridArea.Row); fields.Add() .Caption("Date") .DataField("DateKey") .DataType(PivotGridDataType.Date) .Area(PivotGridArea.Column); fields.Add() .Caption("Amount") .DataField("SalesAmount") .SummaryType(SummaryType.Sum) .Format(Format.Currency) .Area(PivotGridArea.Data); fields.Add() .Caption("Store") .DataField("StoreName"); fields.Add() .Caption("Quantity") .DataField("SalesQuantity") .SummaryType(SummaryType.Sum); fields.Add() .Caption("Store") .DataField("StoreName"); fields.Add() .Caption("Unit Price") .DataField("UnitPrice") .SummaryType(SummaryType.Sum) .Format(Format.Currency); fields.Add() .DataField("Id") .Visible(false); }) ) )
using DevExtreme.NETCore.Demos.Models.SampleData; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; namespace DevExtreme.NETCore.Demos.Controllers { public class PivotGridController : Controller { public ActionResult WebAPIService() { return View(); } } }