Skip to main content
All docs
V23.2

ColumnView.DataError Event

Fires when an error occurs in the data controller and allows you to handle the error.

Namespace: DevExpress.XtraGrid.Views.Base

Assembly: DevExpress.XtraGrid.v23.2.dll

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

Declaration

[DXCategory("Action")]
public event EventHandler<ColumnViewDataErrorEventArgs> DataError

Event Data

The DataError event's data class is DevExpress.XtraGrid.Views.Base.ColumnViewDataErrorEventArgs.

Remarks

The grid control displays a tooltip if there is an error in the data controller:

Error Tooltip - WinForms Data Grid, DevExpress

The DataError event allows you to handle errors in the data controller.

You can modify the error message displayed in the tooltip:

using DevExpress.XtraGrid.Views.Base;

void gridView1_DataError(object sender, ColumnViewDataErrorEventArgs e) {
    e.DisplayMessage = "Specify a custom error message.";
}

Set the e.Handled property to true to hide the tooltip. The following example logs the error and hides the tooltip:

using DevExpress.XtraGrid.Views.Base;

void gridView1_DataError(object sender, ColumnViewDataErrorEventArgs e) {
    Log(e.DataException.Message);
    e.Handled = true;
}
See Also