I have just implemented INotifyDataErrorInfo in my RVM's and the behavior I am seeing isn't what I expect but maybe I have something wrong.
I have a column that is bound to a string property through DataMemberBinding with no templates. There is a validation on the column that checks the length of the string entered, if over 8chars it adds an error. So, if I type to long of an entry and attempt to leave the cell I get my validation method message and indicator but then I notice the following:
Now I get a weird visual of the error indicator on the cell. My row has no height and there is a stackpanel that has the row showing higher then desired but its testing so who cares. Well, so the row is like 45px tall, but when you put the above string column into edit mode the textbox it shows is only around 20px high. When I type in a long value and the validation shows up I see a validation attached to the textbox, and I see a validation attached to the cell...so I see two indicators on a single cell.
So how do I properly clear the error collection when the grid doesn't call setter? Not gonna do this in code behind events - what other options are there?
Thank you
I have a column that is bound to a string property through DataMemberBinding with no templates. There is a validation on the column that checks the length of the string entered, if over 8chars it adds an error. So, if I type to long of an entry and attempt to leave the cell I get my validation method message and indicator but then I notice the following:
- If I backspace and manually put the data back to the way it was before editing and I leave the cell it never calls Set on that property therefore my vaildation never runs to remove the error...so though the data is correct the row still shows an error indicator. I can leave the cell and edit other stuff...but since the error never gets removed from the collection the row shows errors. This does NOT happen if I use a CellEditTemplate with a textbox with text={binding prop, mode=twoway}.
Now I get a weird visual of the error indicator on the cell. My row has no height and there is a stackpanel that has the row showing higher then desired but its testing so who cares. Well, so the row is like 45px tall, but when you put the above string column into edit mode the textbox it shows is only around 20px high. When I type in a long value and the validation shows up I see a validation attached to the textbox, and I see a validation attached to the cell...so I see two indicators on a single cell.
So how do I properly clear the error collection when the grid doesn't call setter? Not gonna do this in code behind events - what other options are there?
Thank you