Ticket T1278533
Visible to All Users

Binding Error raised when deleting Item from SeriesItemSource DataSource

created 11 days ago

Clipboard-File-1.png
After I clicked the button, there was a binding failure.
How can I avoid this situation from happening.

Answers approved by DevExpress Support

created 10 days ago

Hello,

After reviewing the code, I found that when an item is removed from the item source, its template temporarily inherits the data context of its parent in the hierarchy (e.g., MainViewModel). Since this new context lacks the properties of the original data context, a binding error occurs.

Although the UI element is eventually removed, the item template remains in the visual tree briefly before being garbage collected. This triggers the binding error due to the missing properties. However, this error can be safely ignored because I confirmed that the UI components are properly removed afterward.

As a workaround, you can define empty properties in MainViewModel to ensure bindings resolve without errors. Although this won't provide meaningful values, it will prevent binding errors in the application.

Alternatively, you can utilize priority binding that allows a property to be bound to multiple data sources. Select the first one that provides a valid (non-null, non-default) value. For more details, refer to this help topic: How to: Implement PriorityBinding.

Please let me know if this helps.

Regards,
Steven

    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.