Autor Beitrag
Sabine
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 40


Delphi 7
BeitragVerfasst: Do 23.06.05 12:35 
Hallöchen,


ich habe in einem DBGrid folgenden Inhalt:

03.00
02.11
00.00
04.15


So diesen Inhalt will ich absteigend sortiert haben.
Wie krieg ich das hin?

Das habe ich schon funktioniert aber nicht. Wer kann ads koriegieren?

CloseDataSet(handle_pos);
Form1.RxMemoryData2.Refresh;
Form1.RxMemoryData2.First;
Form1.RxMemoryData2.SortOnFields('Pos-Nr', FALSE, FALSE);
SQLException
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 89

WinXP + D5 Enterprise
Win2k + D6 Personal
BeitragVerfasst: Fr 24.06.05 09:12 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
procedure THauptForm.DBGridTitleClick(Column: TColumn);
var
  spalte: String;
begin
  spalte := Column.FieldName;
  ADOQuery1.Active := False;
  if aufsteigend then
  begin
    ADOQuery1.SQL.Text := 'Select * from Kunden Order by ' + spalte + '';
    aufsteigend := false;
  end
  else
  begin
    ADOQuery1.SQL.Text := 'Select * from Kunden Order by ' + spalte + '' + ' DESC';
    aufsteigend := true;
  end;
  ADOQuery1.Active   := True;
end;