Articles in this section
Category / Section

How to print specific pages in WinForms GridControl?

1 min read

Print the specific pages

In order to print specific pages of GridControl, the “PagesToPrint” property of GridPrintDocumentAdv can be used. The page numbers can be provided as the list of integer values.

C#

private void btnPrint_Click(object sender, EventArgs e)
{
   GridPrintDocumentAdv pd = new GridPrintDocumentAdv(this.gridControl1);
   PrintPreviewDialog previewDialog = new PrintPreviewDialog();
   //Print particular pages.
   pd.PagesToPrint = new List<int>(new int[] { 1, 3, 5 });
   previewDialog.Document = pd;
   previewDialog.Show();
}

 

VB

private void btnPrint_Click(Object sender, EventArgs e)
   Dim pd As New GridPrintDocumentAdv(Me.gridControl1)
   Dim previewDialog As New PrintPreviewDialog()
   'Print particular pages.
   pd.PagesToPrint = New List(Of Integer)(New Integer() { 1, 3, 5 })
   previewDialog.Document = pd
   previewDialog.Show()
End Sub

 

Samples:

C#: PrintParticularPages_CS

VB: PrintParticularPages_VB

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

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied