I am having a problem with the GridView: if the row is marked invalid because a property is invalid, the user is unable to edit any other cell.
Let's say I have a GridView that is letting me edit a class called Person that has 3 properties
- Name: the person's name
- Type: which allows the user to choose between Child or Adult
- Age: that is validated according to the Person type (child is allowed to be between 1 - 19, adult is allowed to be between 19-120)
Now, let's say the user adds a new Person and enters a name, selects child as the person type by accident and enters an age of 30. Because the Person is actually not a child, the age property becomes invalid and the row is set to invalid.
At this point the user is not able to change the Type to Adult because they cannot leave the age field.
This is particularly a problem if the user attempts to save a person without entering an age or type because the row becomes invalid, the type is not selected and the field that the user is stuck in is the Age field. They cannot edit the type column and so the age is always going to be invalid.
How do I get around this?