Data Binding

The Data Grid was moved to maintenance support mode. No new features/capabilities will be added to this component. We recommend that you migrate to the Grid component.

Date
Forecast
Cloud Cover
Temp. (℃)
Temp. (℉)
Sunday, April 21, 2024 Cold Storm 5 41
Monday, April 22, 2024 Cold Sunny 4 39.2
Tuesday, April 23, 2024 Cold Storm 6 42.8
Wednesday, April 24, 2024 Cold Sunny 8 46.4
Thursday, April 25, 2024 Cold Sunny 6 42.8

Our Blazor Data Grid allows you to display, manage, and manipulate tabular data with absolute ease. You can use the Data property to bind the grid to a strongly typed collection. Initialize this collection in the OnInitialized lifecycle method or before this method is invoked. To display data within our Blazor Grid, simply add columns to the markup and use the Field property to assign data fields as needed.

Asynchronous Data Binding

The Data Grid was moved to maintenance support mode. No new features/capabilities will be added to this component. We recommend that you migrate to the Grid component.

Company Name
Contact Name
Contact Title
Country
City
Address
Phone
Exotic Liquids Charlotte Cooper Purchasing Manager UK London 49 Gilbert St. (171) 555-2222
New Orleans Cajun Delights Shelley Burke Order Administrator USA New Orleans P.O. Box 78934 (100) 555-4822
Grandma Kelly's Homestead Regina Murphy Sales Representative USA Ann Arbor 707 Oxford Rd. (313) 555-5735
Tokyo Traders Yoshi Nagase Marketing Manager Japan Tokyo 9-8 Sekimai Musashino-shi (03) 3555-5011
Cooperativa de Quesos 'Las Cabras' Antonio del Valle Saavedra Export Administrator Spain Oviedo Calle del Rosal 4 (98) 598 76 54
of 6

Use the DataAsync property to bind our Blazor Data Grid to a strongly typed collection that is loaded asynchronously (for instance, from an HTTP request). This property allows you to prevent excessive re-rendering and draw the grid's UI skeleton before data is loaded. The property specifies an asynchronous function that returns a Task<IEnumerable<T>> object and accepts a CancellationToken object as a parameter.

GitHub Example: How to bind the Data Grid to a strongly typed collection loaded asynchronously

Custom Data Binding

The Data Grid was moved to maintenance support mode. No new features/capabilities will be added to this component. We recommend that you migrate to the Grid component.

Customer ID
Order Date
Freight
Ship Country
Ship Via

If your data is stored in a remote service and is loaded through a Web API, assign the data type to the grid's T parameter and use the CustomData property to implement desired data load logic. This property specifies an asynchronous function that accepts two parameters: a DataSourceLoadOptionsBase object that reflects the current grid state and a CancellationToken object that propagates cancellation notifications. In this function, you can use the ConvertToGetRequestUri and ConvertToHttpContent extension methods to generate HTTP requests with parameters based on data load options. The function should return a Task object.

On the remote service, implement an API controller and create action methods that use the DataSourceLoader class to create a LoadResult object based on load options.

In this demo, the Data Grid and the Customer ID and Ship Via combobox columns are bound to a remote Web API service. The ConvertToGetRequestUri extension method is used to generate a GET request URI with parameters based on data load options. The Web API controller uses the DataSourceLoader.Load method to load data.

Large Datasets

The Data Grid was moved to maintenance support mode. No new features/capabilities will be added to this component. We recommend that you migrate to the Grid component.

State
Area
County
Location
Year
Bedrooms
Rent
Population
MA Boston Ayer town Middlesex County 2022 1 $1,826.00 8,015
MA Boston Natick town Middlesex County 2022 1 $2,380.00 35,955
MA Berkshire County Windsor town Berkshire County 2021 3 $1,650.00 910
PA Pittsburgh Westmoreland County Westmoreland County 2021 3 $1,140.00 356,835
MA Springfield Hampden town Hampden County 2020 4 $2,280.00 5,195
NY Binghamton Broome County Broome County 2020 0 $550.00 196,125
TN Nashville Cheatham County Cheatham County 2021 2 $1,440.00 39,715
MA Boston Reading town Middlesex County 2021 3 $2,690.00 25,770
MA Boston Saugus town Essex County 2021 2 $2,350.00 28,035
RI Providence Barrington town Bristol County 2021 0 $1,200.00 16,220
of 198767

In this demo, the DevExpress Blazor Data Grid is bound to a data collection with over a million rows (1GB+ in overall size). Navigate between grid pages, sort data, or filter data to experience our Blazor DataGrid's responsiveness and performance capabilities when binding to large datasets.

You can use any of the ways demonstrated above (the Data, DataAsync, or CustomData property) to bind the grid to a large data collection. The collection must implement the IQueryable<T> interface. This demo uses the DataAsync property and Entity Framework Core.