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 the grid in WinForms GridControl?

Platform: WinForms |
Control: GridControl
Tags: printing

Print the grid

The GridPrintDocument class implements the printing logic needed to print multi-page Grids. For example, here is a button click event handler that shows you how to use this GridPrintDocument class.



private void Print_Click(object sender, EventArgs e)
 if (gridControl1 != null)
   GridPrintDocument gpd = new GridPrintDocument(this.gridControl1);
   PrintDialog pd = new PrintDialog();
   pd.Document = gpd;
   pd.AllowSelection = true;
   pd.AllowSomePages = true;
   DialogResult result = pd.ShowDialog();
   if (result == DialogResult.OK)
  catch (Exception ex)
   MessageBox.Show("Error Occured" + ex.Message);



Private Sub Print_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button1.Click
 If gridControl1 IsNot Nothing Then
   Dim gpd As New GridPrintDocument(Me.gridControl1)
   Dim pd As New PrintDialog()
   pd.Document = gpd
   pd.AllowSelection = True
   pd.AllowSomePages = True
   Dim result As DialogResult = pd.ShowDialog()
   If result = System.Windows.Forms.DialogResult.OK Then
   End If
  Catch ex As Exception
   MessageBox.Show("Error Occured" & ex.Message)
  End Try
 End If
End Sub



C#: Print the grid

VB: Print the grid


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