zoukankan      html  css  js  c++  java
  • DevExpress.Data.Filtering.Helpers.LikeData.CreateContainsPattern已过时

    View Code
       protected override string OnCreateLookupDisplayFilter(string text, string displayMember)
            {
                List<CriteriaOperator> subStringOperators = new List<CriteriaOperator>();
                foreach (string sString in text.Split(' '))
                {
                    string exp = DevExpress.Data.Filtering.Helpers.LikeData.CreateContainsPattern(sString);
                    List<CriteriaOperator> columnsOperators = new List<CriteriaOperator>();
                    foreach (GridColumn col in Columns)
                    {
                        if (col.Visible && col.ColumnType == typeof(string))
                            columnsOperators.Add(new BinaryOperator(col.FieldName, exp,BinaryOperatorType.Like));
                    }
                    subStringOperators.Add(new GroupOperator(GroupOperatorType.Or, columnsOperators));
                }
                return new GroupOperator(GroupOperatorType.And, subStringOperators).ToString();
            }

    修改成以下代码

    View Code
          protected override string OnCreateLookupDisplayFilter(string text, string displayMember)
            {
                List<CriteriaOperator> subStringOperators = new List<CriteriaOperator>();
                foreach (string sString in text.Split(' '))
                {
                    List<CriteriaOperator> columnsOperators = new List<CriteriaOperator>();
                    foreach (GridColumn col in Columns)
                    {
                        if (col.Visible && col.ColumnType == typeof(string))
                            columnsOperators.Add(new FunctionOperator(FunctionOperatorType.Contains, new OperandProperty(col.FieldName), sString));
                    }
                    subStringOperators.Add(new GroupOperator(GroupOperatorType.Or, columnsOperators));
                }
                return new GroupOperator(GroupOperatorType.And, subStringOperators).ToString();
            }

    以上代码来源官网论坛

  • 相关阅读:
    python两个dict相加
    rpm命令
    python logging模块不支持多进程写到一个log文件
    技术论坛地址收集
    visudo命令编辑修改/etc/sudoers配置文件
    健康是什么
    .net文件类型种种
    禁止脚本的运行
    静态页面的值传递
    datagrid数据导出到excel文件给客户端下载的几种方法 (转)
  • 原文地址:https://www.cnblogs.com/freexiaoyu/p/2694875.html
Copyright © 2011-2022 走看看