Blazor DataGrid Example - Template Column Exporting
Order ID Press Ctrl space to group | Name Press Ctrl space to group | Email ID | Freight | Order Date Press Ctrl space to group | Ship Country Press Ctrl space to group |
|---|
| No records to display |
This sample demonstrates how to export DataGrid templates, customized captions, and footer aggregates to PDF and Excel file formats.
The Blazor DataGrid supports template exporting, enabling you to preserve custom column layouts during export. Use the Template property of the GridColumn component to define custom column content. Access template data using the implicit Context parameter.
The DataGrid supports aggregates in the footer, group footer, and group caption using the GridAggregates component for flexible aggregate configuration.
In this demo:
- The Email column is rendered as hyperlinks in the grid and exported to Excel and PDF
- Custom export styling is applied using ExcelQueryCellInfoEvent and PdfQueryCellInfoEvent
- Group caption aggregation for the Freight column is exported using GroupCaptionTemplate
- Custom group captions are exported using ExcelGroupCaptionTemplateInfo and PdfGroupCaptionTemplateInfo events
- Footer aggregates are customized through ExcelAggregateTemplateInfo and PdfAggregateTemplateInfo events
Grouping is disabled for the Email and Freight columns to maintain focus on the template and aggregate export functionality.
For more detailed information about template exporting, refer to the exporting documentation.