使用 SetCustomizedString汉化UltraWinGrid的筛选

网上有 汉化UltraWinGrid筛选的代码不过没说明怎样使用(大概是觉得简单)
Private Function GridFilter_Customizer()
        Dim rc As Infragistics.Shared.ResourceCustomizer = Infragistics.Win.UltraWinGrid.Resources.Customizer
        '如果不写“ = Infragistics.Win.UltraWinGrid.Resources.Customizer”则会抱错:未处理的“System.NullReferenceException”类型的异常出现在 #### 中。其他信息: 未将对象引用设置到对象的实例。

        rc.SetCustomizedString("RowFilterDropDownAllItem", "所有")
        rc.SetCustomizedString("RowFilterDropDownBlanksItem", "空")
        rc.SetCustomizedString("RowFilterDropDownCustomItem", "自定义")
        rc.SetCustomizedString("RowFilterDropDownNonBlanksItem", "非空")
        rc.SetCustomizedString("RowFilterDropDownAllItem", "所有")
        rc.SetCustomizedString("RowFilterDialogTitlePrefix", "输入过滤准则为")
        rc.SetCustomizedString("FilterDialogAndRadioText", "并且")
        rc.SetCustomizedString("FilterDialogOrRadioText", "或者")
        rc.SetCustomizedString("FilterDialogAddConditionButtonText", "增加一个条件(&N)")
        rc.SetCustomizedString("FilterDialogDeleteButtonText", "删除一个条件")
        rc.SetCustomizedString("FilterDialogOkButtonText", "确定(&O)")
        rc.SetCustomizedString("FilterDialogCancelButtonText", "取消(&C)")
        rc.SetCustomizedString("FilterDialogOkButtonNoFiltersText", "不过滤")
        rc.SetCustomizedString("RowFilterDialogOperatorHeaderCaption", "比较运算符")
        rc.SetCustomizedString("RowFilterDialogOperandHeaderCaption", "准则")
        rc.SetCustomizedString("RowFilterDropDownEquals", "等于")
        rc.SetCustomizedString("RowFilterDropDownNotEquals", "不等于")
        rc.SetCustomizedString("RowFilterDropDownLessThan", "小于")

        rc.SetCustomizedString("RowFilterDropDownLessThanOrEqualTo", "小于等于")
        rc.SetCustomizedString("RowFilterDropDownGreaterThan", "大于")
        rc.SetCustomizedString("RowFilterDropDownGreaterThanOrEqualTo", "大于等于")
        rc.SetCustomizedString("RowFilterDropDownMatch", "自定义规则表达式")
        rc.SetCustomizedString("RowFilterDropDownLike", "模糊查找")

        rc.SetCustomizedString("RowFilterDialogBlanksItem", "空白")
        rc.SetCustomizedString("RowFilterDialogDBNullItem", "无值")
        rc.SetCustomizedString("RowFilterDialogEmptyTextItem", "空字符")

        rc.SetCustomizedString("RowFilterDropDown_Operator_Equals", "等于")
        rc.SetCustomizedString("RowFilterDropDown_Operator_NotEquals", "不等于")
        rc.SetCustomizedString("RowFilterDropDown_Operator_LessThan", "小于")
        rc.SetCustomizedString("RowFilterDropDown_Operator_LessThanOrEqualTo", "小于等于")
        rc.SetCustomizedString("RowFilterDropDown_Operator_GreaterThan", "大于")
        rc.SetCustomizedString("RowFilterDropDown_Operator_GreaterThanOrEqualTo", "大于等于")
        rc.SetCustomizedString("RowFilterDropDown_Operator_Match", "自定义规则表达式")
        rc.SetCustomizedString("RowFilterDropDown_Operator_Like", "模糊查找")

        rc.SetCustomizedString("RowFilterPatternCaption", "无效查找模式")
        rc.SetCustomizedString("RowFilterPatternError", "错误的解析模式{0}. 请输入一个有效的表达式")
        rc.SetCustomizedString("RowFilterPatternException", "无效查找模式{0}")
        rc.SetCustomizedString("RowFilterRegexError", "无效的规则表达式{0}.请输入一个有效的表达式")
        rc.SetCustomizedString("RowFilterRegexErrorCaption", "无效规则表达式")
        rc.SetCustomizedString("RowFilterRegexException", "无效规则表达式{0}")
    End Function

然后在初始化时调用GridFilter_Customizer()即可。
总结:
整个过程就是:利用Customizer成员的SetCustomizedString方法自定义显示。利用此方法亦可汉化Infragistics其它控件的显示:
有关key和value参考:
 http://help.infragistics.com/NetAdvantage/2005.3/HelpFiles/20053/WinGrid_Message_Strings_Customization.html

转载于:https://www.cnblogs.com/zhangjidong/archive/2006/05/29/412059.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值