If you use the grid’s Print method, the entire grid will be printed unless you create a GridPrintDocument object, set its properties and call its Print method instead. By setting the GridPrintDocument’s PrinterSettings.FromPage and .ToPage to define the range of pages to print. If you want to decide on a page-by-page basis, you must handle the QueryPrintPage event where you can set the IsPageSelected boolean to decide if that page should be printed.
VB.NET
Dim printDocument As New GridPrintDocument(GridControl1)
printDocument.PrinterSettings.PrintRange = Drawing.Printing.PrintRange.SomePages printDocument.PrinterSettings.FromPage = 2 printDocument.PrinterSettings.ToPage = 5
printDocument.Print()
C#
GridPrintDocument printDocument = New GridPrintDocument(GridControl1);
printDocument.PrinterSettings.PrintRange = Drawing.Printing.PrintRange.SomePages; printDocument.PrinterSettings.FromPage = 2; printDocument.PrinterSettings.ToPage = 5;
printDocument.Print();
|
Imported from legacy forums. Posted by Xceed admin (had 750 views)