DataGridView.OnDataError(Boolean, DataGridViewDataErrorEventArgs) Method

Definition

Raises the DataError event.

protected:
 virtual void OnDataError(bool displayErrorDialogIfNoHandler, System::Windows::Forms::DataGridViewDataErrorEventArgs ^ e);
protected virtual void OnDataError (bool displayErrorDialogIfNoHandler, System.Windows.Forms.DataGridViewDataErrorEventArgs e);
abstract member OnDataError : bool * System.Windows.Forms.DataGridViewDataErrorEventArgs -> unit
override this.OnDataError : bool * System.Windows.Forms.DataGridViewDataErrorEventArgs -> unit
Protected Overridable Sub OnDataError (displayErrorDialogIfNoHandler As Boolean, e As DataGridViewDataErrorEventArgs)

Parameters

displayErrorDialogIfNoHandler
Boolean

true to display an error dialog box if there is no handler for the DataError event.

Remarks

Raising an event invokes the event handler through a delegate. For more information, see Handling and Raising Events.

The OnDataError method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.

Notes to Inheritors

When overriding OnDataError(Boolean, DataGridViewDataErrorEventArgs) in a derived class, be sure to call the base class' OnDataError(Boolean, DataGridViewDataErrorEventArgs) method so that registered delegates receive the event.

Applies to

See also