WinForms

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class GridPrintDocumentAdv - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class GridPrintDocumentAdv

    Implements printing support for the Grid with options to draw header, footer and scale columns to fit

    Inheritance
    System.Object
    GridPrintDocument
    GridPrintDocumentAdv
    GroupingGridPrintDocumentAdv
    MultiGridPrintDocument
    PivotGridPrintDocumentAdv
    Inherited Members
    GridPrintDocument.PageSettingsChanged
    GridPrintDocument.PagesToPrint
    GridPrintDocument.IsPrintPreview
    GridPrintDocument.CustomBounds
    GridPrintDocument.IsPDFExport
    GridPrintDocument.HelperPageSettings
    Namespace: Syncfusion.GridHelperClasses
    Assembly: Syncfusion.GridHelperClasses.Windows.dll
    Syntax
    public class GridPrintDocumentAdv : GridPrintDocument

    Constructors

    GridPrintDocumentAdv()

    Initializes a new instance of the GridPrintDocumentAdv class.

    Declaration
    public GridPrintDocumentAdv()

    GridPrintDocumentAdv(GridControlBase)

    Initializes a new instance of the GridPrintDocumentAdv class.

    Declaration
    public GridPrintDocumentAdv(GridControlBase grid)
    Parameters
    Type Name Description
    GridControlBase grid

    The parent grid for this object.

    Fields

    fixedRowIndex

    Fixed Row Index

    Declaration
    protected int fixedRowIndex
    Field Value
    Type Description
    System.Int32

    Properties

    FooterHeight

    Gets or sets a value that specifies the height of the footer.

    Declaration
    public int FooterHeight { get; set; }
    Property Value
    Type Description
    System.Int32

    FooterPrintStyleInfo

    Gets or sets the Footer text and styles. FooterPrintStyleInfo.Text accepts custom tokens. See the remarks for allowed Tokens.

    Declaration
    public GridStyleInfo FooterPrintStyleInfo { get; set; }
    Property Value
    Type Description
    GridStyleInfo
    Remarks

    FooterPrintStyleInfo.Text Format Tokens are:

    TokenDescription
    {PageNumber}Displays the current printing page
    {PageCount}Displays the total print pages
    {PrintDate}Displays the current date in ShortDate format
    {PrintTime}Displays the current time in ShortTime format

    HeaderHeight

    Gets or sets a value that specifies the height of the header.

    Declaration
    public int HeaderHeight { get; set; }
    Property Value
    Type Description
    System.Int32

    HeaderPrintStyleInfo

    Gets or sets the Header text and styles. HeaderPrintStyleInfo.Text accepts custom tokens. See the remarks for allowed Tokens.

    Declaration
    public GridStyleInfo HeaderPrintStyleInfo { get; set; }
    Property Value
    Type Description
    GridStyleInfo
    Remarks

    HeaderPrintStyleInfo.Text Format Tokens are:

    TokenDescription
    {PageNumber}Displays the current printing page
    {PageCount}Displays the total print pages
    {PrintDate}Displays the current date in ShortDate format
    {PrintTime}Displays the current time in ShortTime format

    PagesToFit

    Gets or sets the number of pages to fit the grid, this property will be work only when the PrintColumnToFitPage property is enabled.

    Declaration
    public int PagesToFit { get; set; }
    Property Value
    Type Description
    System.Int32

    PrintColumnToFitPage

    Gets or sets a value indicating whether to fit the grid to the number of pages specified in PagesToFit.

    Declaration
    public bool PrintColumnToFitPage { get; set; }
    Property Value
    Type Description
    System.Boolean

    ScaleColumnsToFitPage

    Gets or sets a value indicating whether the Grid's column should be scaled to fit the print page.

    Declaration
    public bool ScaleColumnsToFitPage { get; set; }
    Property Value
    Type Description
    System.Boolean
    Remarks

    If the Grid's width exceeds print page, Grid will be scaled to fit the columns in the page while rows will span over to the next page

    Methods

    DrawHeaderFooterText(GridPrintHeaderFooterTemplateArgs, Boolean)

    Draws the header and footer and writes text in it

    Declaration
    public void DrawHeaderFooterText(GridPrintHeaderFooterTemplateArgs template, bool header)
    Parameters
    Type Name Description
    GridPrintHeaderFooterTemplateArgs template

    A GridPrintHeaderFooterTemplateArgsthat contains the event data

    System.Boolean header

    Indicates whether cell is header cell.

    OnBeginPrint(PrintEventArgs)

    Overridden to start the printing of cells.

    Declaration
    protected override void OnBeginPrint(PrintEventArgs ev)
    Parameters
    Type Name Description
    System.Drawing.Printing.PrintEventArgs ev

    The System.Drawing.Printing.PrintEventArgs that contains the event data.

    Overrides
    GridPrintDocument.OnBeginPrint(PrintEventArgs)

    OnDrawGridPrintFooter(GridPrintHeaderFooterTemplateArgs)

    Raises the DrawGridPrintFooter event

    Declaration
    protected virtual void OnDrawGridPrintFooter(GridPrintHeaderFooterTemplateArgs e)
    Parameters
    Type Name Description
    GridPrintHeaderFooterTemplateArgs e

    A GridPrintHeaderFooterTemplateArgsthat contains the event data

    OnDrawGridPrintHeader(GridPrintHeaderFooterTemplateArgs)

    Raises the DrawGridPrintHeader event

    Declaration
    protected virtual void OnDrawGridPrintHeader(GridPrintHeaderFooterTemplateArgs e)
    Parameters
    Type Name Description
    GridPrintHeaderFooterTemplateArgs e

    A GridPrintHeaderFooterTemplateArgsthat contains the event data

    OnEndPrint(PrintEventArgs)

    Overridden to set the margins.

    Declaration
    protected override void OnEndPrint(PrintEventArgs e)
    Parameters
    Type Name Description
    System.Drawing.Printing.PrintEventArgs e

    The System.Drawing.Printing.PrintEventArgs that contains the event data.

    Overrides
    GridPrintDocument.OnEndPrint(PrintEventArgs)

    OnPrintPage(PrintPageEventArgs)

    Overridden to draw the header and footer.

    Declaration
    protected override void OnPrintPage(PrintPageEventArgs ev)
    Parameters
    Type Name Description
    System.Drawing.Printing.PrintPageEventArgs ev

    The System.Drawing.Printing.PrintEventArgs that contains the event data.

    Overrides
    GridPrintDocument.OnPrintPage(PrintPageEventArgs)

    Events

    DrawGridPrintFooter

    Handle this event to draw Footer to the Grid print document

    Declaration
    public event GridPrintDocumentAdv.DrawGridHeaderFooterEventHandler DrawGridPrintFooter
    Event Type
    Type Description
    GridPrintDocumentAdv.DrawGridHeaderFooterEventHandler

    DrawGridPrintHeader

    Handle this event to draw Header to the Grid print document

    Declaration
    public event GridPrintDocumentAdv.DrawGridHeaderFooterEventHandler DrawGridPrintHeader
    Event Type
    Type Description
    GridPrintDocumentAdv.DrawGridHeaderFooterEventHandler
    Back to top Generated by DocFX
    Copyright © 2001 - 2021 Syncfusion Inc. All Rights Reserved