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
Declaration
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:
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