Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
150
Custom Condition and NotificationSettings Text
posted

Hello,

I have to validate a control against multiple different conditions. I have created a Custom Condition class and put my conditions in the Matches subroutine.

What I'd like to do is to customize also the Notification settings text that appears when one of the conditions is not matched. I can do this by passing the Control object and Validator object in the constructor of my class. The problem is that the Matches subroutine is not raised when the control value is empty, and so I can't customize the message in the "isRequired" condition is True.

To be more specific:

If the condition 1 is false, notification text has to be "Condition 1 not satisfied"

If the condition 2 is false, notification text has to be "Condition 2 not satisfied"

If the value is empty (and isRequired is true), notification text has to be "Value mandatory"

I'm not able to do the last one because Matches event is not raised when leaving the control with value empty, so notification text remains the older one (for example "Condition 2 not satisfied").

Parents Reply Children
No Data