Kelkun a une facon simple de le faire ?
voici ce que jai essayer mais jobtiens un erreur de mémoire quand je fais requete := 'select * from ip.db ORDER BY ' + Column.Title.Caption;
procedure Tconsultation_ip.DBGrid1TitleClick(Column: TColumn);
var requete,requete2:string;
i:integer;
begin
query1.Close;
query1.sql.clear;
requete := 'select * from ip.db ORDER BY ' + Column.Title.Caption;
query1.sql.add(requete);
query1.open;
datasource1.DataSet := query1;
datasource1.DataSet.Active := true;
DBGrid1.Refresh;
for i:=0 to DBGrid1.Columns.count-1 do begin
DBGrid1.Columns[i].Title.Color := clBtnFace;
DBGrid1.Columns[i].Title.Font.Color := clBlack;
DBGrid1.Columns[i].Title.Font.Style := [];
end;
Column.Title.color := ClYellow;
Column.Title.Font.Style := [ fsBold, fsItalic];
Column.Title.Font.Color := clRed;
end;
Merci !!!