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

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.v24.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