Skip to main content

ConnectionErrorEventArgs Class

Serves as the base for classes that provide data for the ConnectionError events.

Namespace: DevExpress.DataAccess.Sql

Assembly: DevExpress.DataAccess.v24.1.dll

NuGet Packages: DevExpress.DataAccess, DevExpress.Win.PivotGrid, DevExpress.Win.TreeMap


public class ConnectionErrorEventArgs :


The Cancel property specifies whether the operation performed on the processed event should be canceled. This option does not have any effect in the WPF and Web Dashboard controls. Only the WinForms Dashboard Designer and Viewer use it to cancel displaying the Connection Error dialog.

The Handled property indicates whether the event was handled. Set the property to true after you modify connection parameters in this event to connect with these new parameters. This property also cancels the default connection error message. You can display your custom dialog in case of a connection error and allow end users to change connection parameters.

The following example shows how to handle ConnectionError event for a WPF Dashboard Control:

private void dashboardControl_ConnectionError(object sender, ConnectionErrorWpfEventArgs e) {
    // Display your custom connection dialog
    // ...

    e.ConnectionParameters = new ExcelDataSourceConnectionParameters(@"C:/Temp/ExcelWorkbook.xlsx");
    e.Handled = true;
See Also