Blazor DataGrid Example - Detail Template Exporting
First Name | Last Name | Title | Country |
|---|
This sample demonstrates the export functionality of detail templates in the DataGrid, allowing you to export detailed grid content to Excel and PDF file formats.
The Blazor DataGrid detail template feature displays additional information about specific rows when expanded or collapsed. Wrap the required content with the DetailTemplate within the GridTemplates component. Expanded rows are useful for visualizing hierarchical statistical data.
Enable detail row exporting by configuring the following properties in export settings:
- Set PdfDetailRowMode in PdfExportProperties to
Expandfor PDF exports. - Set ExcelDetailRowMode in ExcelExportProperties to
Expandfor Excel exports.
Customize detail row exports using the following events:
- PdfDetailTemplateExporting - Customize PDF detail row exports.
- ExcelDetailTemplateExporting - Customize Excel detail row exports.
The detail template exporting supports the following modes:
- Expand - Exports all detail rows in an expanded state.
- Collapse - Exports detail rows in a collapsed state (Excel exporting only).
- None - Exports only parent rows without details.
In this demo, detail row exporting is configured to expand all rows and export detailed employee information.
For more detailed information about exporting features, refer to the Excel export documentation.