procedure TFrm_Main.DBGridEh1TitleBtnClick(Sender: TObject; ACol: Integer;
Column: TColumnEh);
begin
case Column.Title.SortMarker of
smNoneEh:
begin
Column.Title.SortMarker := smDownEh;
Dm.Qry_main.Sort:=DBGridEh1.Columns[ACol].Field.FieldName+' ASC';
end;
smDownEh:
begin
Column.Title.SortMarker := smUpEh;
Dm.Qry_main.Sort:=DBGridEh1.Columns[ACol].Field.FieldName+' DESC';
end;
smUpEh: Column.Title.SortMarker := smNoneEh;
end;
end;
1.在TitleBtnClick事件中
2.删除用Delete就OK了