FlexGrid lets you print the grid and perform various basic and advanced print settings using its built-in methods and properties.
FlexGrid provides PrintGrid method of the C1FlexGrid class which lets you print the grid contents with some basic printing options. The method has an optional parameter PrintGridFlags that allows you to specify how to print the grid such as its scaling mode and whether to display various print related dialog boxes. You can also set text in header and footer of the printed grid using this method.
Following code shows how to use PrintGrid method to print the WinForms FlexGrid.
To set advanced printing options such as header and footer fonts, page margins, and page orientation, you can use PrintParameter property of the C1FlexGrid class.
Use the code below to print the WinForms FlexGrid with advanced print options.
You can customize the print preview dialog by using PrintPreviewDialog property of the GridPrinter class. The property can be accessed through PrintParameter property of the C1FlexGrid class. The code below uses the PrintPreviewDialog property to display a maximized preview dialog with a custom caption.
Below code demonstrates how to customize the print preview dialog of the WinForms FlexGrid.