Hello,
I've a simple XamGrid with a bounded items source. I want to validate the bounded data and highlight the column correspondingly.The user should now correct these data.
I've looked into the validation part of the documentation but this only refers to the validation of data, the user enters into the specific controls at runtime.
How can I achieve this?
Oh, here is the example...
Hm ok,
I've attached a new example.
The problem is now to bound the Visibility of the icon to the results of the ValueConstraint(s). Because the HasDataError Property is gone (I don't wan to implement IDataErrorInfo).
The icon-column has no property, that indicates, that the row has on or more ValueConstraint errors.
Here is a screenshot to make that clear.
Hi
Sorry but I do not think I understand what you mean by: The ValueConstraint doesn't make the Icon visible.
In the sample you attached a ValueConstraint is not met and the error icon [the red star is visible.] When a cell is not meeting both Validation Constraint rule and IDataErrorInfo validation the error icon will show the ValueConstraint error message.
Pease let me know if I misunderstood you.
-Slavi
Oh, there is one more problem...
The ValueConstraint doesn't make the Icon visible.
This is because the HasDataError is saved in the object but the result of the ValueConstraint not.
I'ive created a new class without implementing IDataErrorInfo to demonstrate it:
public class MyClass { public decimal Price { get; set; }}
Currently, I have no idea to solve that. Is there a container object for constraint errors per row or something like that?
PS:I only want to have one place to define validating... I think ValueConstraints can be implemented easier
Hi,
Thank you so much!
Actually, it is more simple. The additional column should only indicate, if there is an error in any field or not.So that the user look for these indicators (or filter) and than he see the single cell errors perhaps with a red square...
I can build up on your example.
I will post my modified example for other user...