Hi all,
I seem to be having problems trying to get the PropertyGrid to recognise the fact that my selected objects implement IDataErrorInfo and wanted to make sure I've not missed anything. Basically I have a main window that is set as the DataContext for my application and the PropertyGrid SelectedObjects field is data bound to a SelectedObjects field in the main window that returns an observable collection of objects. Now I add an object to my collection and sure enough the PropertyGrid reflects over it correctly. I then implement IDataErrorInfo on my object with the folowing:If I add a break point to the getter in the second method it is never called. I've been through the demo app and implemented the Validation.Error="OnPropertyGridValidationError" event handler just to prove that validation works and sure enough if I edit a property and enter a value of the wrong type (string instead of int ca.) then I view the correct error message in the list view.
Am I missing something in the PropertyGrid to enable the IDataErrorInfo validation, it's not clear from the demo code?
Thanks
Rick
I seem to be having problems trying to get the PropertyGrid to recognise the fact that my selected objects implement IDataErrorInfo and wanted to make sure I've not missed anything. Basically I have a main window that is set as the DataContext for my application and the PropertyGrid SelectedObjects field is data bound to a SelectedObjects field in the main window that returns an observable collection of objects. Now I add an object to my collection and sure enough the PropertyGrid reflects over it correctly. I then implement IDataErrorInfo on my object with the folowing:
string IDataErrorInfo.Error
{
get { return null; }
}
string IDataErrorInfo.this[string columnName]
{
get
{
...
}
}
Am I missing something in the PropertyGrid to enable the IDataErrorInfo validation, it's not clear from the demo code?
Thanks
Rick