Ticket T296111
Visible to All Users

DxErrorProvider - How to use it for properties marked with the 'Required' attribute

created 9 years ago

[DevExpress Support Team: CLONED FROM T266518: DataLayoutControl - Databinding Problem with LookupEdit and Complex Object]
Okay I have one more question related to databinding a property that is a complex object and required attributes.
I have the property defined as this…

C#
[Required()] public WagePaymentMethod ClaimantWagePaymentMethod { get { return GetProperty(wagePaymentMethodProperty); } set { SetProperty(wagePaymentMethodProperty, value); } }

However, the dxErrorProvider is not enforcing this required attribute for the LookUpEdit control bound to this.  Why?  Is there a trick to get that type of scenario to work?

Answers approved by DevExpress Support

created 9 years ago

Hello Mark,
Business objects must implement the DevExpress.XtraEditors.DXErrorProvider.IDXDataErrorInfo interface to provide error information for DXErrorProvider. Attached is a small sample that illustrates how to use it with the Complaint  class.
Please review it and let me know if this approach suits your needs.

    Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

    Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.