Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

problem with validationsummary and view model implementing INotifyDataErrorInfo

I guess my question is how the heck does validationsummary determine what its going to show?

I have a view model implementing INotifyDataErrorInfo and some validation errors get shown in my validationsummary whereas others do not and I can't see what the difference is.

Also, how can I get object level errors to show up? For object level errors, do I use null string.empty or something different?

update

The 2 properties that will not show up in the validationsummary are observablecollection.

Still not solved.

like image 458
Ronnie Overby Avatar asked Apr 14 '26 15:04

Ronnie Overby


1 Answers

Make sure that your ValidatesOnNotifyDataErrors=True,NotifyOnValidationError=True,etc are on the correct property.

I had a similar problem once where I wasn't getting an error to show up where I expected, because those properties were set in the binding statement of SelectedItem and not ItemsSource. Also, the ValidationSummary will use SelectedItem property's bound property to identify to the user the Title of the property that an error occurred on, regardless of which property you are actually validating. So make sure that you put a Display attribute on that property to make things look nice for the user.

like image 154
Great Gonzo Avatar answered Apr 16 '26 04:04

Great Gonzo