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 Print Preview the WinForms GridControl?

Platform: WinForms |
Control: GridControl
Tags: printing

Print preview

The GridPrintDocument class implements the printing logic needed to print multi-page Grids and the object of the GridPrintDocument is associated with the PrintPreviewDialog to display the print preview dialog.

For example, you can print preview the Grid by using the following code.


private void PrintPreview_Click(object sender, EventArgs e)
 if (this.gridControl1 != null)
   GridPrintDocument gpd = new GridPrintDocument(this.gridControl1, true);
   PrintPreviewDialog pd = new PrintPreviewDialog();
   pd.Document = gpd;
  catch (Exception ex)
   MessageBox.Show("Error Occured" + ex.Message);



Private Sub PrintPreview_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button1.Click
 If Me.gridControl1 IsNot Nothing Then
   Dim gpd As New GridPrintDocument(Me.gridControl1, True)
   Dim pd As New PrintPreviewDialog()
   pd.Document = gpd
  Catch ex As Exception
   MessageBox.Show("Error Occured" & ex.Message)
  End Try
 End If
End Sub


The following screenshot displays the Print preview dialog.

Print preview window is opened



C#: Print preview

VB: Print preview


Reference link: https://help.syncfusion.com/windowsforms/grid-control/printing

2X faster development

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