Users should be allowed to use standard methods to validate their objects. For instance, they would prefer implementing IDXDataErrorInfo interface for data objects instead of using the standard validation system. This feature must be supported in XAF by default.
We have closed this ticket because another page addresses its subject:
Validation - Warn end-users about mistakes/inconsistencies without preventing them from saving changes
In addition to implementing the interface, pretty please also define an Exception baseclass to be used for XAF, so exceptions can be raised in property setters and / or OnSaving / OnDeleting overrides. This exception could provide certain base properties like the error text; or a message reference ID that could refer to localized messages in the Application Model. Another useful property on this exception class would be a parameter dictionary allowing the XAF subsystem to substitute formatting placeholders with the parameters.
Short example:
raise new XpoValidationException("Msg_ID_001", new object[] {obj.Name, obj.Budget - Project.MaxBudget}) where Msg_ID_001 would refer to localizable strings: "The budget for project '{0}' is exceded by {1} dollars".
I'm pretty sure most developers would like to keep their validation logic contained within the business classes and dedicated exceptions are in my opinion a rather elegant way to propagate validation errors up the system.
Hi,
Currently, as a workaround, you need to create a custom grid list editor based on the standard one, and override the GetColumnError type to allow custom ErrorTypes to be displayed in the grid control.
You also need to add a new controller that will set the column errors. Please look at the GridControlViewController in the attached sample project.
Thanks,
Dennis