Flat Grid Demo

This sample shows you how to print a grid on a single page. It derives a GridPrintDocumentAdv class in order to handle the printing of multiple grids across various pages.

Features:

Print FlatGrid screenshot

Interactive Features:

                        Syncfusion.GridHelperClasses.GridPrintDocumentAdv pd = new Syncfusion.GridHelperClasses.GridPrintDocumentAdv(this.gridGroupingControl1);
                        Bitmap gridBM = new Bitmap(gridWidth, gridHeight);
                        / Can spacify the length of the margin.
                         pd.DefaultPageSettings.Margins = new System.Drawing.Printing.Margins(25, 25, 25, 25);
                        
                        //The height of the margin can be zero if it has to be hidden
                                            pd.HeaderHeight = 70;
                                            pd.FooterHeight = 50;
                        //Events for both header and footer
                         pd.DrawGridPrintHeader += new Syncfusion.GridHelperClasses.GridPrintDocumentAdv.DrawGridHeaderFooterEventHandler(pd_DrawGridPrintHeader);
                                 pd.DrawGridPrintFooter += new Syncfusion.GridHelperClasses.GridPrintDocumentAdv.DrawGridHeaderFooterEventHandler(pd_DrawGridPrintFooter);

                        //This can be spacified to whether the columns should be fit in single page.
                         pd.ScaleColumnsToFitPage = true;

The following is an image of the print preview dialog box.

Print FlatGrid screenshot