Autor Beitrag
rai
Hält's aus hier
Beiträge: 14



BeitragVerfasst: Di 20.07.04 14:08 
Hallo!

Ich habe leider mit der Suche nicht gefunden, wie ich eine Mehrfach-Auswahl in einem DBGrid (MultiSelect) auswerten kann. Soll heißen, wie finde ich denn heraus, welche Einträge nun markiert sind? bzw. wie komme ich an deren Daten..
.. in meinem Fall will ich daraus eine Liste (Array) erstellen, die ich dann weiterverarbeite.

Danke
JoelH
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 806
Erhaltene Danke: 17

Win10
Delphi Alexandria 11.2 Patch 1
BeitragVerfasst: Di 04.01.05 08:21 
Titel: hmm,

_________________
mfg. Joel
bnessler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 36

alle Win's , suse u. Ubuntu Linux
Delphi1,2,4,5,7,2005, Java (Eclipse), C++,C#, (VS2005)
BeitragVerfasst: Di 04.01.05 09:17 
Hallo

direkt aus der Delphi Hilfe.

Gruß
Bernhard
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
procedure TForm1.Button1Click(Sender: TObject);
var
  i, j: Integer;
  s: string;
begin
  if DBGrid1.SelectedRows.Count>0 then
    with DBGrid1.DataSource.DataSet do
      for i:=0 to DBGrid1.SelectedRows.Count-1 do
      begin
        GotoBookmark(pointer(DBGrid1.SelectedRows.Items[i]));
        for j := 0 to FieldCount-1 do
        begin

          if (j>0) then s:=s+', ';
          s:=s+Fields[j].AsString;
        end;
        Listbox1.Items.Add(s);
        s:= '';
      end;
end;