Back to Devexpress

DataViewBase.ShowPrintPreviewDialog(Window, String) Method

wpf-devexpress-dot-xpf-dot-grid-dot-dataviewbase-dot-showprintpreviewdialog-x28-system-dot-windows-dot-window-system-dot-string-x29.md

latest2.6 KB
Original Source

DataViewBase.ShowPrintPreviewDialog(Window, String) Method

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

Declaration

csharp
public void ShowPrintPreviewDialog(
    Window owner,
    string documentName
)
vb
Public Sub ShowPrintPreviewDialog(
    owner As Window,
    documentName As String
)

Parameters

NameTypeDescription
ownerWindow

The owner of the Print Preview.

| | documentName | String |

The name of the document displayed in the Print Preview.

|

Remarks

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.

View Example

csharp
void Print_Data(object sender, RoutedEventArgs e) {
    view.ShowPrintPreviewDialog(this, "ExamplePrint");
}
vb
Private Sub Print_Data(ByVal sender As Object, ByVal e As RoutedEventArgs)
    view.ShowPrintPreviewDialog(Me, "ExamplePrint")
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:

See Also

DataViewBase Class

DataViewBase Members

DevExpress.Xpf.Grid Namespace