Skip to main content

NavigatorBase.NavigatorException Event

Provides control over exceptional situations which might occur while navigating/editing records using the data navigator.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v22.2.dll

NuGet Package: DevExpress.Win.Navigation


public event NavigatorExceptionEventHandler NavigatorException

Event Data

The NavigatorException event's data class is NavigatorExceptionEventArgs. The following properties provide information specific to this event:

Property Description
Button Gets the navigator’s button which caused the exception when it was pressed.
ErrorText Gets or sets the error description to be displayed in the message box/tooltip. Inherited from ExceptionEventArgs.
Exception Gets the exception that caused the event. Inherited from ExceptionEventArgs.
ExceptionMode Gets or sets the type of response to supplying invalid values. Inherited from ExceptionEventArgs.
WindowCaption Gets or sets the caption of the error message box. Inherited from ExceptionEventArgs.


While navigating/editing records using the data navigator, exceptions might occur due to restrictions on the data source. For instance, pressing the EndEdit button might cause an exception if the current record contains invalid data and therefore, it cannot be saved to the data source. The data navigator intercepts the exceptions raised by the data source and fires the NavigatorException events in their place.

The event’s ExceptionEventArgs.ExceptionMode parameter of the ExceptionMode type specifies how the event (exception) should be handled. It is possible to suppress displaying any messages, re-throw the exception or display a custom error message. To display the error message, for instance, you can set the ExceptionMode parameter to ExceptionMode.DisplayError and assign the error text to the ExceptionEventArgs.ErrorText parameter.

The exception raised by the data source is specified by the ExceptionEventArgs.Exception parameter.

See Also