Herkese merhabalar,
DBgridin "OnTitleClick" ine assagidaki kodu yaz bu yeterli.
Ama programinin uses kismina "DB" ekli degilse eklemeyi unutma
with dbgrid1.datasource.dataset as ttable do
indexfieldnames:=column.field.fieldname;
veya
procedure TForm1.DBGrid1TitleClick(Column: TColumn);
begin
if ADODST.IndexFieldNames=Column.Field.FieldName then
ADODST.IndexFieldNames:=Column.Field.FieldName+' DESC'
else
ADODST.IndexFieldNames:=Column.Field.FieldName;
end;