DevExtreme v26.1 is now available.

Explore our newest features/capabilities and share your thoughts with us.

Your search did not match any results.

Angular Data Grid - Remote Grouping

Remote (server-side) operations can boost the DataGrid's performance on large datasets. In this demo, the DataGrid works with a million records seamlessly because they are processed on the server.

To notify the DataGrid that it works with a pre-processed dataset, set the remoteOperations property to true.

Backend API
<dx-data-grid id="gridContainer" [dataSource]="dataSource" [remoteOperations]="{ groupPaging: true }" [wordWrapEnabled]="true" [width]="'100%'" [showBorders]="true" > <dxo-data-grid-scrolling mode="virtual"></dxo-data-grid-scrolling> <dxo-data-grid-group-panel [visible]="true"></dxo-data-grid-group-panel> <dxo-data-grid-grouping #expand [autoExpandAll]="false" ></dxo-data-grid-grouping> <dxi-data-grid-column dataField="Id" dataType="number" [width]="75" ></dxi-data-grid-column> <dxi-data-grid-column dataField="ProductSubcategoryName" caption="Subcategory" [width]="150" ></dxi-data-grid-column> <dxi-data-grid-column dataField="StoreName" caption="Store" [width]="150" [groupIndex]="0" ></dxi-data-grid-column> <dxi-data-grid-column dataField="ProductCategoryName" caption="Category" [width]="120" [groupIndex]="1" ></dxi-data-grid-column> <dxi-data-grid-column dataField="ProductName" caption="Product" ></dxi-data-grid-column> <dxi-data-grid-column dataField="DateKey" caption="Date" dataType="date" format="yyyy-MM-dd" [width]="100" ></dxi-data-grid-column> <dxi-data-grid-column dataField="SalesAmount" caption="Amount" format="currency" [width]="100" ></dxi-data-grid-column> <dxo-data-grid-summary> <dxi-data-grid-group-item column="Id" summaryType="count"> </dxi-data-grid-group-item> </dxo-data-grid-summary> </dx-data-grid>
import { bootstrapApplication } from '@angular/platform-browser'; import { Component, enableProdMode, ChangeDetectionStrategy, provideZoneChangeDetection } from '@angular/core'; import { DxDataGridModule } from 'devextreme-angular'; import * as AspNetData from 'devextreme-aspnet-data-nojquery'; if (!/localhost/.test(document.location.host)) { enableProdMode(); } @Component({ selector: 'demo-app', templateUrl: './app.component.html', styleUrls: ['./app.component.css'], changeDetection: ChangeDetectionStrategy.OnPush, imports: [ DxDataGridModule, ], }) export class AppComponent { dataSource = AspNetData.createStore({ key: 'Id', loadUrl: 'https://js.devexpress.com/Demos/WidgetsGalleryDataService/api/Sales', }); } bootstrapApplication(AppComponent, { providers: [ provideZoneChangeDetection({ eventCoalescing: true, runCoalescing: true }), ], });
::ng-deep #gridContainer { height: 420px; width: 100%; }
<!DOCTYPE html> <html lang="en"> <head> <title>DevExtreme Demo</title> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/26.1.5/css/dx.light.css" /> </head> <body class="dx-viewport"> <div class="demo-container"> <demo-app>Loading...</demo-app> </div> <script src="https://cdn.jsdelivr.net/npm/zone.js@0.16.2/bundles/zone.umd.js"></script> <script src="./bundle.js" type="module"></script> </body> </html>

You can also specify properties that allow the DataGrid to load data on demand to reduce the amount of transmitted data. Set the grouping.autoExpandAll property to false to collapse all the groups at startup. Data for each group is loaded only when the user expands the group. Enable the "virtual" scrolling.mode to load only those records that come into the viewport when the grid is scrolled vertically.

The DataGrid communicates with the server according to a protocol. Refer to the Server-Side Data Processing article for information on it.

The data source in this demo is configured to return only 1000 records per request.