Example of Detail Template Exporting in Blazor DataGrid Component

DataGrid / Exporting / Detail Template Exporting

This sample demonstrates the export functionality of the detail template in a DataGrid, allowing you to export the detailed grid to Excel and PDF file formats.

When expanding or collapsing the detail content, the Blazor DataGrid detail template feature displays additional information about a specific row. With the required content, the DetailTemplate should be wrapped around the GridTemplates component. This expanded row is used to visualize the statistical data hierarchy.

In this demo, the detail row mode for exporting is enabled by setting PdfDetailRowMode and ExcelDetailRowMode to Expand in the PdfExportProperties and ExcelExportProperties.

You can customize the detail row using PdfDetailTemplateExporting and ExcelDetailTemplateExporting events. In this, we customize and export detailed employee information in the detail row.

The detail template allows you to export the grid with the following options:

  • Expand - Exports all the detail rows in an expanded state.
  • Collapse - Exports the detail rows in a collapsed state (specifically for Excel exporting).
  • None - Exports only parent rows.

More information about the Exporting feature can be found in this documentation section.

Transform your Blazor web apps today with Syncfusion® Blazor components
100+ high-performance and responsive UI components
Dedicated support
Hassle-free licensing
TRY IT FOR FREE