We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to set Header and Footer while exporting SfDataGrid into PDF?

Platform: UWP |
Control: SfDataGrid

The SfDataGrid can be exported into Pdf with Header and Footer using PdfHeaderFooterEventHandler property in PdfExportingOptions.



You can insert string, image or any drawing in header and footer in PdfHeaderFooterEventHandler. Setting PdfPageTemplateElement to PdfHeaderFooterEventArgs.PdfDocumentTemplate.Top loads the content at top of the page and setting the PdfPageTemplateElement to PdfHeaderFooterEventArgs.PdfDocumentTemplate.Bottom loads the content at bottom of the page.

Drawing string in Header

String can be inserted in header or footer by using DrawString method. In the same way, you can insert image, ellipse or arc into the header or footer.




Drawing image in Footer

Image can be inserted in header or footer using DrawImage method.





WPF Sample

WinRT Sample

UWP Sample

2X faster development

The ultimate UWP UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile