过滤条件,无需经过过滤界面,不知是否可行?
-----------------------------------------------
可行.
回答完毕   呵呵devexpress跟进源码, 找到文件代入点, 自己改写一下.

解决方案 »

  1.   

    1 把这三个文件移到你的程序目录:
      cxFilterControlDialog.pas, cxFilterControlDialog.dfm, cxGridCustomTableView.pas;
    2 修改cxFilterControlDialog.pas// Added by Simon 2013/9/4 10:05:13
    //声明 全局
    function cxInternalExecuteFilterControlDialogEx(ALink: TComponent; const AFileName : string): Boolean;
    //实现
    function cxInternalExecuteFilterControlDialogEx(ALink: TComponent; const AFileName : string): Boolean;
    var
      AForm: TfmFilterControlDialog;
      AIntf: IcxFilterControlDialog;
    begin
      AForm := TfmFilterControlDialog.Create(Application);
      with AForm do
      try
        FFilterControl := TcxFilterControl.Create(nil);    if Supports(TObject(FFilterControl), IcxFilterControlDialog, AIntf) then
          AIntf.SetDialogLinkComponent(ALink);
        AIntf := nil; //force to clear interface    FilterControl.LoadFromFile(AFileName);
        SetTitle(AFileName);    FilterControl.ApplyFilter;
        Result := True;
      finally
        FFilterControl.Free;
        Free;
      end;
    end;修改cxGridCustomTableView.pas//TcxCustomGridTableFiltering public 声明
    procedure LoadFilterFile(const AFileName : string);//实现
    procedure TcxCustomGridTableFiltering.LoadFilterFile(const AFileName : string);
    begin
      if not GridView.DoFilterCustomization then
         cxInternalExecuteFilterControlDialogEx(GridView, AFileName);
    end;界面调用
      
    //tv1 : TcxGridBandedTableView
    tv1.DataController.Filter.Active := True;
      tv1.Filtering.LoadFilterFile('c:\2.flt');
      

  2.   

    simonhehe,非常感谢多次热心的帮助,问题解决!
      

  3.   

    怎么解决的,我的一直提示[Error] cxFilterControlDialog.pas(306): Undeclared identifier: 'TcxFilterControlDialog'