DevExtreme v26.1 is now available.

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

Your search did not match any results.

React 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
import React from 'react'; import DataGrid, { Scrolling, Paging } from 'devextreme-react/data-grid'; import { generateData } from './data.ts'; const dataSource = generateData(50, 500); const App = () => ( <DataGrid height={440} dataSource={dataSource} keyExpr="field1" showBorders={true} columnWidth={100} > <Scrolling columnRenderingMode="virtual" /> <Paging enabled={false} /> </DataGrid> ); export default App;
import React from 'react'; import DataGrid, { Scrolling, Paging } from 'devextreme-react/data-grid'; import { generateData } from './data.js'; const dataSource = generateData(50, 500); const App = () => ( <DataGrid height={440} dataSource={dataSource} keyExpr="field1" showBorders={true} columnWidth={100} > <Scrolling columnRenderingMode="virtual" /> <Paging enabled={false} /> </DataGrid> ); export default App;
import React from 'react'; import ReactDOM from 'react-dom'; import App from './App.tsx'; ReactDOM.render( <App />, document.getElementById('app'), );
export function generateData(rowCount: number, columnCount: number) { let i; let j; const items: Record<string, string>[] = []; for (i = 0; i < rowCount; i += 1) { const item: Record<string, string> = {}; for (j = 0; j < columnCount; j += 1) { item[`field${j + 1}`] = `${i + 1}-${j + 1}`; } items.push(item); } return items; }
import React from 'react'; import ReactDOM from 'react-dom'; import App from './App.js'; ReactDOM.render(<App />, document.getElementById('app'));
export function generateData(rowCount, columnCount) { let i; let j; const items = []; for (i = 0; i < rowCount; i += 1) { const item = {}; for (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" /> <link rel="stylesheet" type="text/css" href="styles.css" /> </head> <body class="dx-viewport"> <div class="demo-container"> <div id="app"></div> </div> <script src="bundles/vendor/react.vendor.js"></script> <script src="./bundle.js"></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.