Skip to main content
A newer version of this page is available. .

DocumentPreviewWindow.PreviewControl Property

Provides access to the integrated document preview control.

Namespace: DevExpress.Xpf.Printing

Assembly: DevExpress.Xpf.Printing.v19.1.dll

Declaration

public DocumentPreviewControl PreviewControl { get; }

Property Value

Type Description
DocumentPreviewControl

A DocumentPreviewControl object that is integrated in the current window.

Remarks

To create a custom DocumentPreviewWindow, assign the corresponding XtraReport or link to the DocumentViewerControl.DocumentSource property (available via the PreviewControl property).

using DevExpress.Xpf.Printing;
using System.Windows;
// ...

private void Button_Click(object sender, RoutedEventArgs e) {
    XtraReport1 report = new XtraReport1();
    var window = new DocumentPreviewWindow();
    window.PreviewControl.DocumentSource = report;
    report.CreateDocument();
    window.Show();
}

Make sure to call the XtraReport.CreateDocument method before displaying the Print Preview.

wpf-standard-document-preview

See Also