单击DBGrid列头自动排序

procedure DBGridItemsTtileClick(Column: TColumnEh);
  begin
    if DBGridItems.Focused then
      with cdsBillItems do
        if Active and not(Bof and Eof) then
          if FindField(Column.FieldName)<>nil then
            IndexFieldNames:=Column.FieldName;
  end;
原文地址:https://www.cnblogs.com/CNQCJ/p/2179600.html