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 - Horizontal Virtual Scrolling

Horizontal virtual scrolling improves performance by rendering only displayed columns. To enable this feature, set scrolling.columnRenderingMode to "virtual".

Backend API
<dx-data-grid id="grid" [dataSource]="dataSource" keyExpr="field1" [columnWidth]="100" [showBorders]="true" > <dxo-data-grid-paging [enabled]="false"></dxo-data-grid-paging> <dxo-data-grid-scrolling columnRenderingMode="virtual" ></dxo-data-grid-scrolling> </dx-data-grid>
import { bootstrapApplication } from '@angular/platform-browser'; import { Component, enableProdMode, provideZoneChangeDetection } from '@angular/core'; import { DxDataGridModule, DxDataGridTypes } from 'devextreme-angular/ui/data-grid'; import { DataSourceOptions } from 'devextreme-angular/common/data'; import { Service } from './app.service'; if (!/localhost/.test(document.location.host)) { enableProdMode(); } @Component({ selector: 'demo-app', templateUrl: './app.component.html', styleUrls: ['./app.component.css'], providers: [Service], imports: [ DxDataGridModule, ], }) export class AppComponent { columns: DxDataGridTypes.Column[]; dataSource: DataSourceOptions; constructor(service: Service) { const columnCount = 500; const rowCount = 50; this.dataSource = service.getData(rowCount, columnCount); } } bootstrapApplication(AppComponent, { providers: [ provideZoneChangeDetection({ eventCoalescing: true, runCoalescing: true }), ], });
::ng-deep #grid { max-height: 440px; }
import { Injectable } from '@angular/core'; @Injectable() export class Service { getData(rowCount, columnCount) { const items = []; for (let i = 0; i < rowCount; i += 1) { const item = {}; for (let j = 0; j < columnCount; j += 1) { item[`field${j + 1}`] = `${i + 1}-${j + 1}`; } items.push(item); } return items; } }
<!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 scroll the component's data horizontally using Shift + Scroll Wheel. Utilize the Home/End keys to jump to the focused row's first/last cells, and Ctrl + Home/Ctrl + End to jump to the first cell of the first row/last cell of the last row.