This example exports the contents of our WPF GridControl with specified page headers and footers.
- Create custom templates for headers and footers.
- Create a new instance of the PrintableControlLink class.
- Assign the templates to the PageHeaderTemplate and PageFooterTemplate properties.
- Print or export the WPF GridControl in WYSIWYG mode.
Refer to the following help topic for more information: WYSIWYG Export.
- Create a new instance of the XlsxExportOptionsEx class.
- Handle both XlsxExportOptionsEx.CustomizeSheetHeader and XlsxExportOptionsEx.CustomizeSheetFooter events.
- In the event handlers, specify custom page headers and footers.
- Export the WPF GridControl in XLSX format.
Refer to the following help topic for more information: Data-Aware Export.
- Window1.xaml (VB: Window1.xaml)
- Window1.xaml.cs (VB: Window1.xaml.vb)
- WPF Data Grid - Customize the Print and Export Appearance
- WPF Data Grid - Export to a Native Excel Table
(you will be redirected to DevExpress.com to submit your response)