Infragistics UltraValidator新增功能 [英] Infragistics UltraValidator new

查看:54
本文介绍了Infragistics UltraValidator新增功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用基础设施UltraValidator.我想从验证消息框中删除文本验证失败并出现以下错误".请帮帮我

I am using infragistics UltraValidator. I want to remove the text "validation failed with the following error(s)" from validate message box. please help me out

代码在这里>>

private void uValidate_ValidationError(object sender, ValidationErrorEventArgs e){

        Infragistics.Win.Misc.ValidationSettings settings;
            settings = this.uValidate.GetValidationSettings( UltraTextEditor );
            settings.NotificationSettings.Action = Infragistics.Win.Misc.NotificationAction.MessageBox;
            settings.NotificationSettings.Caption = "Required Fields";
            settings.NotificationSettings.Text = "Select Customer";
    }


bool ValidateMyControls()
    {
        Infragistics.Win.Misc.Validation v = uValidate.Validate();

        return v.IsValid;
    }

uValidate是UltraValidator控件

uValidate is UltraValidator control

当触发方法ValidateMyControls()时,我将得到一个消息框,该消息框的顶部带有一个字符串验证失败,出现以下错误:".我需要删除或编辑此字符串.

when the method ValidateMyControls() is triggered, I will get a message box, with a string on top "Validation failed with the following error(s):". This string i need to remove or edit.

问候 安菲尔(Anfil)

Regards Anfil

推荐答案

现在我知道这里发生了什么.
您需要自定义由以下内容标识的资源字符串:

Now I understand what's happening here.
You need to customize the resource string identified by:

"Validate_ErrorNotificationMessageHeader"

这是Infragistics.Win.Misc程序集资源中包含的内部字符串,并且在消息选择客户"之前由程序集自动显示.

This is an internal string contained in the resources of the Infragistics.Win.Misc assembly and it is displayed automatically by the assembly before your message "Select Customer".

您可以按照以下说明自定义字符串

You could customize the string with the following instruction

ResourceCustomizer rc = Infragistics.Win.Misc.Resources.Customizer;
rc.SetCustomizedString("Validate_ErrorNotificationMessageHeader", "Your message here");

每个Infragistics程序集都有可用这种方式自定义的字符串列表.
有关可用资源字符串的完整列表,请在此处查看. (这仅适用于WinForms).
处理此任务的最佳方法是在应用程序启动时创建一个仅被调用一次的通用方法(类似于GlobalAppUtility.SetInfragisticsResourceStrings();)

Every Infragistics assembly has a list of strings that can be customized in this way.
For a complete list of the resource strings available look here. (And this is only for WinForms).
The best method to handle this task is to create a generic method called just one time at the startup of your application (Something like GlobalAppUtility.SetInfragisticsResourceStrings(); )

这篇关于Infragistics UltraValidator新增功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆