Export a Blazor DataGrid to Excel and CSV directly in the browser - no server required. Choose between the current page and all rows; exports respect the current sort, filter, column order, format strings, and theme - colors, gridlines and font size, including compact density.
Call ExportToExcelAsync or ExportToCsvAsync and pick a scope - the current page or all filtered and sorted rows.
Rows:
Order ID | Order Date | Product | Unit Price | Quantity | Discount |
|---|---|---|---|---|---|
| 10248 | 07/04/2023 | Queso Cabrales | ¤14.00 | 12 | 0 % |
| 10248 | 07/04/2023 | Singaporean Hokkien Fried Mee | ¤9.80 | 10 | 0 % |
| 10248 | 07/04/2023 | Mozzarella di Giovanni | ¤34.80 | 5 | 0 % |
| 10249 | 07/05/2023 | Tofu | ¤18.60 | 9 | 0 % |
| 10249 | 07/05/2023 | Manjimup Dried Apples | ¤42.40 | 40 | 0 % |
| 10250 | 07/08/2023 | Jack's New England Clam Chowder | ¤7.70 | 10 | 0 % |
| 10250 | 07/08/2023 | Manjimup Dried Apples | ¤42.40 | 35 | 15 % |
| 10250 | 07/08/2023 | Louisiana Fiery Hot Pepper Sauce | ¤16.80 | 15 | 15 % |
| 10251 | 07/08/2023 | Gustaf's Knäckebröd | ¤16.80 | 6 | 5 % |
| 10251 | 07/08/2023 | Ravioli Angelo | ¤15.60 | 15 | 5 % |
This grid loads one page at a time. Exporting all rows requests the filtered and sorted data in chunks, reports progress, and restores the visible page when done.
Rows:
Order ID | Product | Unit Price | Quantity |
|---|
The Total column has no Property; it renders a template on screen and exports through ExportValue, with FormatString applied to the returned value.
ToWorkbookAsync returns the workbook before it is saved so you can customize it with the full spreadsheet API - the customized download appends a totals row with a SUM formula.
Product | Quantity | Unit Price | Total |
|---|---|---|---|
| Queso Cabrales | 12 | ¤14.00 | ¤168.00 |
| Singaporean Hokkien Fried Mee | 10 | ¤9.80 | ¤98.00 |
| Mozzarella di Giovanni | 5 | ¤34.80 | ¤174.00 |
| Tofu | 9 | ¤18.60 | ¤167.40 |
| Manjimup Dried Apples | 40 | ¤42.40 | ¤1,696.00 |
Call ExportToExcelAsync or ExportToCsvAsync on the grid and select the current page or all filtered and sorted rows.
Yes. Exports use the grid's view - the current sort, filter, column order, visibility, and format strings.
Radzen Blazor Components, © 2018-2026 Radzen.
Source Code licensed under
MIT
On this page