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
350
Customize Summary Text
posted

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.

  • 69832
    Offline posted

    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.