When SelectedItem.DT throws an error Validation_Error is not called? DT is a DataTable from a SQL query and I want to display the SQL error if the TSQL fails. I guess I could build a DataTable and put the ex.msg in the table. But I would rather call Validation_Error.
<DataGrid Grid.Row="1" Grid.Column="0" AutoGenerateColumns="True"
ItemsSource="{Binding ElementName=cbReports, Path=SelectedItem.DT, ValidatesOnExceptions=True, NotifyOnValidationError=True, NotifyOnSourceUpdated=True}"
Validation.Error="Validataion_Error" />
This TextBox (on another page) does call Validation_Error when an error is thrown in set.
<TextBox Text="{Binding Path=DF.FieldValue, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}"
Validation.Error="Validataion_Error"/>
DataTable is not implement IDataErrorInfo then it isn’t do any validation error automatically for you. I always transform DataTable to ObservableCollection of my class that implement IDataErrorInfo.
I guess that the reason your textbox binding works is
DFin yourDF.FieldValueis implementIDataErrorInfo.