Skip to main content
All docs
V25.1
  • GanttControlOptionsPrint.PageInfoType Property

    Gets or sets the type of information displayed in the page footer.

    Namespace: DevExpress.XtraGantt.Options

    Assembly: DevExpress.XtraGantt.v25.1.dll

    NuGet Package: DevExpress.Win.Gantt

    Declaration

    [DefaultValue(PageInfo.NumberOfTotal)]
    [XtraSerializableProperty]
    public PageInfo PageInfoType { get; set; }

    Property Value

    Type Default Description
    PageInfo NumberOfTotal

    A value that specifies the type of information.

    Available values:

    Name Description
    None

    Indicates that the PageInfoTextBrick.Format property value is displayed in the current PageInfoTextBrick.

    Number

    Indicates that the current page number is displayed in the PageInfoBrick.

    NumberOfTotal

    Indicates that both the current page number and the total number of pages in the current report are displayed in the current PageInfoBrick.

    RomLowNumber

    Indicates that the current page number is displayed in the PageInfoBrick using roman numerals in lowercase.

    RomHiNumber

    Indicates that the current page number is displayed in the PageInfoBrick using roman numerals in uppercase.

    DateTime

    Indicates that the current date and time are displayed in the PageInfoBrick.

    UserName

    Indicates that the user name for the current thread is displayed in the PageInfoBrick.

    Total

    Indicates that the total number of pages is displayed in the PageInfoBrick.

    Property Paths

    You can access this nested property as listed below:

    Object Type Path to PageInfoType
    GanttControl
    .OptionsPrint .PageInfoType

    Remarks

    You can print the chart legend and additional information in page footers.

    Gantt Control Legend and Page Information

    Legend

    Enable the PrintLegend property to display a chart legend in page footers.

    The AppearancePrint property provides access to appearance settings used to print the control. You can use the following properties to specify how to print the legend:

    • Legend — appearance settings used to print the chart legend.
    • LegendItem — appearance settings used to print items in the chart legend.

    Ensure that the UsePrintStyles property is set to true (the default value) to enable these settings.

    Page Information

    Enable the PrintPageInfo property to display additional information in page footers. The default footer contains the current date, page number, and the total number of pages.

    Use the PageInfoType property to specify the type of information that should be displayed. The PageInfoFormat property allows you to apply a custom format to this information. Use the {0} and {1} placeholders to insert a specific portion of information into the format. The passed content depends on the type of information. For example, if PageInfoType is set to NumberOfTotal, {0} is replaced with the page number, and {1} is replaced with the total number of pages.

    You can also use the PageInfoCaption property to display a custom caption in the page footers.

    The AppearancePrint property provides access to the PageInfo and PageInfoCaption properties that specify appearance settings used to print page information.

    Example

    The code below shows how to display the chart legend and page information.

    Gantt Control Custom Legend

    using System.Drawing;
    using DevExpress.XtraPrinting;
    
    // Print the chart legend.
    ganttControl1.OptionsPrint.PrintLegend = DefaultBoolean.True;
    // Specify custom foreground and background colors for the chart legend.
    ganttControl1.AppearancePrint.Legend.BackColor = Color.FromArgb(224, 224, 224);
    ganttControl1.AppearancePrint.Legend.Options.UseBackColor = true;
    ganttControl1.AppearancePrint.LegendItem.ForeColor = Color.FromArgb(64, 0, 64);
    ganttControl1.AppearancePrint.LegendItem.Options.UseForeColor = true;
    // Print the Project's caption and Project Manager's name in the footer.
    ganttControl1.OptionsPrint.PrintPageInfo = DefaultBoolean.True;
    ganttControl1.OptionsPrint.PageInfoType = XtraPrinting.PageInfo.UserName;
    ganttControl1.OptionsPrint.PageInfoFormat = "Project Manager: {0}";
    ganttControl1.OptionsPrint.PageCaption = "Software Development";
    // Specify the footer background color.
    ganttControl1.AppearancePrint.PageInfo.BackColor = Color.FromArgb(255, 192, 128);
    ganttControl1.AppearancePrint.PageInfo.Options.UseBackColor = true;
    
    See Also