Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

LayoutControl.IsPrintingAvailable Property

Indicates whether the LayoutControl can be printed.

Namespace: DevExpress.XtraLayout

Assembly: DevExpress.XtraLayout.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

[Browsable(false)]
public bool IsPrintingAvailable { get; }

#Property Value

Type Description
Boolean

true if the LayoutControl can be printed; otherwise, false.

#Remarks

The LayoutControl can be printed if the XtraPrinting Library is available. To print the control, call the LayoutControl.Print method.

Note

With the XtraPrinting library you’re also able to export the control to various formats (PDF, HTML, etc.).

#Example

The following example demonstrates how to print a LayoutControl and show its Print Preivew. The LayoutControl.Print and LayoutControl.ShowPrintPreview methods are called respectively.

using DevExpress.XtraLayout;
// ...

private void ShowLayoutControlPreview(LayoutControl layout) {
    // Check whether the LayoutControl can be previewed.
    if (!layout.IsPrintingAvailable) {
        MessageBox.Show("The 'DevExpress.XtraPrinting' library is not found", "Error");
        return;
    }

    // Open the Preview window.
    layout.ShowPrintPreview();
}

private void PrintLayoutControl(LayoutControl layout) {
    // Check whether the LayoutControl can be printed.
    if (!layout.IsPrintingAvailable) {
        MessageBox.Show("The 'DevExpress.XtraPrinting' library is not found", "Error");
        return;
    }

    // Print.
    layout.Print();
}
See Also