Sep 30, 2009 at 6:23 PM
Edited Sep 30, 2009 at 6:24 PM
I'm not sure if I'm doing validation wrong, but here's a simple scenario:
- Define a datagrid without auto-generated columns.
- Define a column with a binding and a validation rule on that binding.
- Edit a cell in the column with the validation rule so that the validation rule is violated.
- The cell turns red, editing is locked to that cell.
This is all expected behavior so far.
5. Now, delete the object with the invalid data from the underlying ItemsSource.
The row will disappear from the grid, but editing in the grid is still locked and will not become available until an entirely different ItemsSource is assigned to the grid.
It seems that the culprit of this is the internal HasCellValidationError flag does not get reset when it should be. This causes the datagrid to become completely readonly.
This seems like a fairly common scenario, is it possible I am doing something wrong? How does one manually clear out a validation error from a cell?