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;
     

     

  • 相关阅读:
    springboot热部署
    maven换仓库地址
    floyd求最小环+例题(hdu1599)
    矩阵乘法+folyd(hdu2807)
    TSP问题+例题
    迪杰斯特拉模板题(迪杰斯特拉模板)
    小w的糖果
    DongDong坐飞机
    DongDong跳一跳
    主席树入门
  • 原文地址:https://www.cnblogs.com/hnxxcxg/p/2940719.html
Copyright © 2011-2022 走看看