Your search did not match any results.
Pivot Grid

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 (part of the DevExtreme.AspNet.Data extension).

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[] { }) .SortOrder(SortOrder.Desc) .Expanded(true) .Area(PivotGridArea.Row); fields.Add() .Caption("Subcategory") .DataField("ProductSubcategoryName") .Width(250) .SortBySummaryField("SalesAmount") .SortBySummaryPath(new string[] { }) .SortOrder(SortOrder.Desc) .Area(PivotGridArea.Row); fields.Add() .Caption("Product") .DataField("ProductName") .Width(250) .SortBySummaryField("SalesAmount") .SortBySummaryPath(new string[] { }) .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(); } } }