zoukankan      html  css  js  c++  java
  • 改良dbgrideh的文字过滤

    uses

       ehlibado;

    改良dbgrideh的文字过滤,原先过虑需要填%字符串%,修改后,直接填入所要搜索的字符串即可,相关代码:

     procedure TSTColumnFilterEh.InternalSetExpressionStr(const Value: String);

      procedure SetLookupKeyValues(var v: Variant);
      var
        i: Integer;
      begin
        if VarIsArray(Expression.Operand1) then
          for i := VarArrayLowBound(Expression.Operand1, 1) to VarArrayHighBound(Expression.Operand1, 1) do
            v[i] := CurrentListDataSet.Lookup(CurrentListField, v[i], CurrentKeyField)
        else
          v := CurrentListDataSet.Lookup(CurrentListField, v, CurrentKeyField)
      end;
    var s: string;       // add by cxg
    begin
      if Value <> '' then  // add by cxg
        if Pos('%', Value) = 0 then
          s := '%'+value+'%';
      ParseExpression(s);
      FExpressionStr := s;
      if (CurrentKeyField <> '') and (CurrentListDataSet <> nil) and (CurrentListField <> '') then
      begin
        if FExpression.Operator1 <> foNon then
          SetLookupKeyValues(FExpression.Operand1);
        if FExpression.Operator2 <> foNon then
          SetLookupKeyValues(FExpression.Operand2);
      end;
    end;
     

     

  • 相关阅读:
    JVM基础和调优(一)
    Jtree(节点的渲染+资源管理器)(2)
    Jtree (节点的渲染+资源管理器)
    jtree(选择框)
    java进阶计划
    SQL优化
    spring 事务管理
    Spring事务配置的五种方式(转)
    spring与数据库之间的配置
    struct2(六) 为表单添加验证
  • 原文地址:https://www.cnblogs.com/hnxxcxg/p/2940719.html
Copyright © 2011-2022 走看看