我用的是ehlib3.4有排序功能,但是怎么用呢?我把dbgrideh1的
sortlocal属性设置为true,
OptionsEh/SghAutoSortMarking属性设置为:True;
然后把要排序的那一列的tiltebutton设置为true,
                      sortmaker唯smdown为什么就是不工作呢?请高人指点

解决方案 »

  1.   

    找到Ehlib目录下的DataService 目录,根据你的数据引擎拷贝相应的文件到你的程序目录下,然后把这个文件添加到你的DBGridEh所在的unit 就行了;
      

  2.   

    不过你说的文件我倒是找到了,也看到readme。但能不能不用这么麻烦啊。好像可以针对titlebutton写pas就可以实现了啊。
      

  3.   

    给你一个例子吧{点击表格头来排序}
    procedure TfrmTemplet.dbGridTitleSort(Sender: TObject;ACol: Integer;
           Column: TColumnEh);
    var dataSet:TAstaClientDataSet;
    begin
      dataSet:=(sender as TDbGridEh).dataSource.dataSet as TAstaClientDataSet;
      if not dataSet.active or dataSet.isEmpty then exit;
      if Column.Title.SortMarker<>smUpEh then
      begin
        dataSet.SortDataSetByFieldName(Column.FieldName,false);
        Column.Title.SortMarker:=smUpEh;
      end else
      begin
        dataSet.SortDataSetByFieldName(Column.FieldName,true);
        Column.Title.SortMarker:=smDownEh;
      end;
    end;
      

  4.   

    Ehlib目录下的DataService 下有三个文件,EhlibAdo,EhlibBde,EhlibCDS,你的程序中用到Ado就把EhlibAdo加入你的程序中,并在需要排序的窗体uses EhlibAdo,用到Bde,就用EhlibBde,用到clientdataset(三层),就用EhlibCDS,其它的设置和你上面写的是一样的!
      

  5.   

    找到Ehlib目录下的DataService 目录,根据你的数据引擎拷贝相应的文件到你的程序目录下,然后把这个文件添加到你的DBGridEh所在的unit 就行了