'How to Catch Binding Error on WPF DataGrid

I have a DataGrid in which all the elements are bound to ViewModel.

Once I enter a character inside a DataGridComboBoxColumn which is bound to a Float. The UI shows an error, however, I can proceed with the previous bound float. I want to catch the binding error before letting the user proceed.

for Example:

enter image description here

now if I enter character "h" in Amplitude Column:

enter image description here

But once I hit the send button, I can proceed with the value of "1" which is entered before a data binding error happens.

I have tried following code but it didn't work:

Validation.GetHasError(NoiseParamDataGrid);

Also, I want to get the error message as well to show in the message box.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source