Skip to main content
All docs
V24.2

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

BaseView.PrintExportCompleted Event

Allows you to determine whether the view data was printed or exported without errors.

Namespace: DevExpress.XtraGrid.Views.Base

Assembly: DevExpress.XtraGrid.v24.2.dll

NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation

#Declaration

[DXCategory("Data")]
public event PrintExportCompletedEventHandler PrintExportCompleted

#Event Data

The PrintExportCompleted event's data class is DevExpress.XtraGrid.Views.Base.PrintExportCompletedEventArgs.

#Remarks

Use the event parameter’s e.Status property to determine whether the operation was successful (GridPrintExportResult.Success), failed (GridPrintExportResult.Error), or was cancelled (GridPrintExportResult.Cancel).

#Example

The following example demonstrates how to display a message box if an error occurs while exporting or printing data in Server Mode:

using DevExpress.XtraEditors;
using DevExpress.XtraGrid.Views.Base;

public Form1() {
    InitializeComponent();
    gridView1.PrintExportCompleted += GridView1_PrintExportCompleted;
}
private void GridView1_PrintExportCompleted(object sender, PrintExportCompletedEventArgs e) {
    if(e.Status == GridPrintExportResult.Error)
        XtraMessageBox.Show(
            new XtraMessageBoxArgs() {
                Text = "An unexpected error occurred while exporting data.",
                Caption = "Error",
                ImageOptions = new MessageBoxImageOptions() {
                    SvgImage = svgImageCollection1[0],
                    SvgImageSize = new Size(32, 32)
                }
            });
}
See Also