hi,
When I validate my UltraValidator I get and summary message box that i do not want only the images but I do not seem to get that disabled?Also there is and text "Validation failed with the following error(s):" how can i manipulate that text?
thanks
Assuming you are triggering validation by calling the 'Validate' method programmatically, that method is overloaded so as to allow you to supress the MessageBox. The name of the parameter is 'showMessageBox'.
You can control the text that gets displayed for a programmatic validation by handling the ValidationError event and setting the ValidationErrorEventArgs.NotificationSettings.Text property.
Brian Fallon"]You can control the text that gets displayed for a programmatic validation by handling the ValidationError event and setting the ValidationErrorEventArgs.NotificationSettings.Text property.
Hi, i did it:
private void uvalCustomer_ValidationError(object sender, Infragistics.Win.Misc.ValidationErrorEventArgs e) { e.NotificationSettings.Text = "Custom Text"; }
But it raise an exception :
This NotificationSettings instance is read-only; property values cannot be modified.
I want to change the default message: "The following error(s) ...."
Lois.
The ValidationErrorEventArgs class exposes a property, IsSingleEntityValidation, which you should check before setting properties of the NotificationSettings. This is because the ValidationError event fires for both single control and multiple control validations. If you use one of the overloads of the Validate method that does not take an explicit Control reference, it is implied to be a validation of multiple controls, and when that is the case, the NotificationSettings property is essentially read-only.
As discussed earlier in this thread, you can pass false as the value of the 'showMessageBox' parameter, and show a MessageBox from the ValidationErrror event handler when the validation is for multiple controls.
I have tried to use the following Validate command but the message is still being displayed.
validator.Validate("GroupKey", false);
I have also tried to set the Action property to None but the message is still being displayed.
NotificationSettings.Action=
NotificationAction.None
Is this known bug?
thanks.
It is now ;)Thanks for bringing this to our attention. This will be addressed in a future release; you might want to report this so that you receive a notification when the fix becomes available.
My bad, I made the same mistake you did. The overload you call in this example is setting the 'showErrorImage' parameter to false, not the 'showMessageBox' parameter. Use the overload that takes (string, bool, bool), and the third parameter is the 'showMessageBox' parameter.
DOH! I don't beleave that I missed that. Thanks for help, this is working fine.