It indicates errors as error icons, which can be hovered over to display error text. To display the supplied errors within the editors, a DXErrorProvider component needs to be added to the form. The MyRecord class implements the IDXDataErrorInfo interface and returns the error information via the IDXDataErrorInfo.GetPropertyError method. In this example, the error information is provided on the data source level. The requirement is to visually indicate errors within the editors, if the record’s FirstName or LastName property contain an empty string. This class’ records are stored in a BindingSource component and edited using text editors (the FirstName and LastName properties are edited in a textEdit1 and textEdit2 controls respectively). It contains two properties ( FirstName and LastName) that cannot be empty. In this example, the business object is represented by a custom MyRecord class. Error information will be handled by the DXErrorProvider component, which will indicate any error to an end-user. The following example demonstrates how to implement error notifications for a custom business object at the data source level, using the IDXDataErrorInfo interface. You can also follow this dataset validation approach, replacing the standard ErrorProvider component with the DXErrorProvider. In addition, it’s possible to provide custom error icons for editors via the DXErrorProvider.GetErrorIcon event. Unlike the standard ErrorProvider component, the DXErrorProvider supports multiple error icon types: Critical, Warning and Information. After a DXErrorProvider has been bound to the data source via the DXErrorProvider.DataSource and DXErrorProvider.DataMember properties, it handles the errors supplied via this interface, and display corresponding error icons within bound editors. To provide error information on the data source level, a business object must implement the IDXDataErrorInfo interface. Indirectly on the data source level (for bound editors). An editor and error information (error text and error icon type) that need to be associated are passed as this method’s parameters.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |