Hi,
I want to change the default message: "Validation failed with the following error(s):" in the summary MessageBox. I read other posts and it says to "control the text that gets displayed for a programmatic validation by handling the ValidationError event and setting the ValidationErrorEventArgs.NotificationSettings.Text property."So 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.
Any solution?
Lois.
Can yo give a quick example?
That happens when you use the overload of the Validate method that validates multiple controls. If you want to display a custom message, use the overload of the Validate method that has the 'showMessageBox' parameter, and set it to false, so the UltraValidator does not display a MessageBox. Then, in the ValidateError event handler, call MessageBox.Show, passing in your customized message.