I'm using WPF and the .NET 4 framework (4.3.30319), on the Windows 7 32-bit OS.
I wanted to keep things simple with validation and my property setter just throws an ArgumentException when the data is not valid, instead of implementing a ValidationRule class. While this worked with a ListBox, it seems it doesn't with a DataGrid. Below
is a simple example to reproduce the problem, check the XAML and C# code related to the 2nd column.
The datagridTBStyle is meant to apply a specific style when an error occurs (since control templates are out of the question with DataGrid), but what I see is:
it applies the correct style when editing the cell (blue text) it doesn't apply the part that is supposed to trigger on Validation.HasError (red on yellow background + tooltip)
Without this style, it doesn't apply a red border around the cell as it should according to the documentation. However, it does put a part of red exclamation mark in the row header when an error occurs, and it catches the exception.
Am I doing something wrong, or is this actually a bug?
Link to the documentation.
Title="Test" Height="200" Width="350&q
View Complete Post