HasCellValidationError does not get reset properly

Sep 30, 2009 at 5:23 PM
Edited Sep 30, 2009 at 5:24 PM

I'm not sure if I'm doing validation wrong, but here's a simple scenario:

  1. Define a datagrid without auto-generated columns. 
  2. Define a column with a binding and a validation rule on that binding.
  3. Edit a cell in the column with the validation rule so that the validation rule is violated.
  4. 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?

Sep 30, 2009 at 5:42 PM

I think this is a bug in the datagrid and I will create an issue accordingly unless anyone has any reasons otherwise :).