Skip to main content
All docs
V24.2

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

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