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 customize PDF Exporting options in GridDataControl?

Platform: WPF |
Control: GridDataControl |
Published Date: July 8, 2014 |
Last Revised Date: July 10, 2014 |
Product Version:

GridDataControl allows you to export the Grid to pdf using the following extension methods ExportToPdf, ExportToPdfDocument, ExportToPdfGrid and ExportToPdfGridDocument that are in the namespace Syncfusion.Windows.Controls.Grid.Converter.

You can customize the exporting by using “ExportToPdfDocument and “ExportToPdf methods that has ExportToPdfOptions as parameter. ExportToPdfOptions provides various options to customize the exporting as per your requirement.

 The list of properties available in ExportToPdfOptions class is as follows

S. No

API Name




When set to True, ExportToPdf method exports the Grid to pdf with styles, otherwise exports the Grid to pdf without any styles (background, foreground, font etc.)

Default Value : True



A Boolean variable determines whether the Header rows are placed in all pdf pages or not.

Default Value : True



A Boolean variable determines whether the Header rows exports or not.

Default Value : True



When set to True’, width is automatically set based on the cell values, otherwise width is copied from Grid.

Default Value : False



A Boolean variable determines whether the ExportToPdf method exports the NestedGrid or not.

Default Value : False



A List<string>. You can exclude the columns by adding the mapping name to “ExcludeColumns” API.



A Boolean variable determines whether the AddNewRow is exported or not.

DefaultValue: False



A Boolean variable determines whether the FilterBar is exported or not.

Default Value : False


You can refer the following code sample to customize the Pdf Exporting Options.


After getting the file name, you can create a new PdfDocument by exporting the Grid. Here the property ExportStyles is set as False so that when you export to pdf, styles are not exported in order to improve the export performance. You can exclude Freight column from export by adding it to ExcludeColumns property. By setting the property RepeatHeaders as False, you can avoid the repetition of headers at every page in the exported pdf.

You can change the font and style of PDFGrid before drawing to PDFdocument. You can refer the following link for more information to customize PDFGrid.


The following screenshots illustrate the exported Pdf files using ExportToPdfDocument.

When ExportStyles is set as True:

When ExportStyles is set as False:

2X faster development

The ultimate WPF 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