Hi -
I've been playing with the WinValidator in a test app; one scenario that is causing me issues which is baflling to me is this:
I have a texteditor associated to a validator - IsRequired. Very simple. I'm also handling the ValidationError event with a switch just like in the docs. That ALL works fine. However, when I call the Validate() method in my Save button click, the ValidationError event fires, but then fails on an invalid object reference to the e.Control.Name in the switch. Note: this event runs fine if fired by the control itself.
How would you then handle the ValidationError event, yet STILL be able to explicity call Validate just prior to saving a form??
I *think* I may have found the solution... is it to check the ValidationErrorEventArgs prop IsSingleEntityValidation and if false, then exit out? That's the only thing I could get to make the above scenario work.
ALSO - what's the best way to do custom code validation and still tap into using the validator and it's notificationsettings for showing and icon/tooltip etc? Is it to leave the default trigger of OnValidating, then in whatever control you want to add custom logic, use GetValidationSettings and set props appropriate to your custom logic?
>> for more complex validation scenarios, such as those defined by the business logic layer, a custom implementation of the ICondition interface can be assigned. <<
Or is that the way to do it? Custom validation code that is. It seems the UltraValidator is very similar to the ASP.NET validators, so I'm trying to equate the IG one's to ASP.NET's.
In the UltraValidator, what would be the equivalent of ASP.NET's CustomValidator & RegularExpressionValidator?
leighkendall said:However, when I call the Validate() method in my Save button click, the ValidationError event fires, but then fails on an invalid object reference to the e.Control.Name in the switch
leighkendall said:what's the best way to do custom code validation and still tap into using the validator and it's notificationsettings for showing and icon/tooltip etc?