Syntax

Remarks

The DXErrorProvider's functionality is similar to the standard System.Windows.Forms.ErrorProvider component. It provides a mechanism for indicating to an end-user that an error is associated with an editor. If an error is associated with an editor, the DXErrorProvider will display an error icon. Hovering over it will invoke a hint with an error description:

An error can be associated with an editor as follows:

directly via the SetError method. An editor and error information (error text and error icon type) that need to be associated are passed as this method's parameters.

In this example, the business object is represented by a custom MyRecord class. It contains two properties (FirstName and LastName) that cannot be empty.
This class' records are stored in a System.Windows.Forms.BindingSource component and edited using text editors (the FirstName and LastName properties are edited in a textEdit1 and textEdit2 controls respectively).

To automatically track errors supplied by a data source, the DXErrorProvider component must be bound to this data source via the DataSource property. In this example, the DataSource property is set to the BindingSource.

The following image illustrates the resulting form after it has been opened at runtime. The editors contain empty strings, and as a result error icons are displayed within the editors: