Blazor DataGrid Example - Print Functionality
Order ID | Customer ID | Order Date | Freight | Ship Country |
|---|
| 10001 | ALFKI | 5/15/1991 | $2.30 | Denmark |
| 10002 | ANATR | 4/4/1990 | $3.30 | Brazil |
| 10003 | ANTON | 11/30/1957 | $4.30 | Germany |
| 10004 | BLONP | 10/22/1930 | $5.30 | Austria |
| 10005 | BOLID | 2/18/1953 | $6.30 | Switzerland |
| 10006 | ALFKI | 5/15/1991 | $4.60 | Denmark |
| 10007 | ANATR | 4/4/1990 | $6.60 | Brazil |
| 10008 | ANTON | 11/30/1957 | $8.60 | Germany |
| 10009 | BLONP | 10/22/1930 | $10.60 | Austria |
| 10010 | BOLID | 2/18/1953 | $12.60 | Switzerland |
| 10011 | ALFKI | 5/15/1991 | $6.90 | Denmark |
| 10012 | ANATR | 4/4/1990 | $9.90 | Brazil |
This sample demonstrates the DataGrid print functionality for generating printable representations of grid data.
The Blazor DataGrid provides print capabilities through the PrintAsync method. When printing:
- The pager is automatically removed from the printed output
- Scrollbars are hidden to provide clean printed content
- All pages are printed by default
You can control the print behavior using the PrintMode property:
- AllPages - Prints all pages of the DataGrid (default)
- CurrentPage - Prints only the currently visible page
In this demo, click the toolbar button to trigger the print functionality. The DataGrid will prepare data for printing and open the browser's print dialog.
For more detailed information about the print feature, refer to the print documentation.