wpf-devexpress-dot-xpf-dot-grid-dot-dataviewbase-dot-showprintpreviewdialog-x28-system-dot-windows-dot-window-x29.md
Creates the print document from the DataViewBase (or its inheritor) and displays a Print Preview of the document as a modal window.
Namespace : DevExpress.Xpf.Grid
Assembly : DevExpress.Xpf.Grid.v25.2.Core.dll
NuGet Package : DevExpress.Wpf.Grid.Core
public void ShowPrintPreviewDialog(
Window owner
)
Public Sub ShowPrintPreviewDialog(
owner As Window
)
| Name | Type | Description |
|---|---|---|
| owner | Window |
The owner of the Print Preview.
|
The Print Preview displays the printed document’s appearance. The Print Preview window allows end users to print the document and export it to a file in the required format.
void Print_Data(object sender, RoutedEventArgs e) {
view.ShowPrintPreviewDialog(this);
}
Private Sub Print_Data(ByVal sender As Object, ByVal e As RoutedEventArgs)
view.ShowPrintPreviewDialog(Me)
End Sub
Note
You can preview, print, and export the control’s data only if the DXPrinting Library is available.
Refer to the following topics for more information on how to print data:
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ShowPrintPreviewDialog(Window) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
wpf-data-grid-print-and-export-data/CS/Window1.xaml.cs#L10
void PreviewGrid(object sender, RoutedEventArgs e) {
view.ShowPrintPreviewDialog(this);
}
wpf-data-grid-print-and-export-data/VB/Window1.xaml.vb#L14
Private Sub PreviewGrid(ByVal sender As Object, ByVal e As RoutedEventArgs)
Me.view.ShowPrintPreviewDialog(Me)
End Sub
See Also