simple example….
1 2 3 4 5 6 7 8 9 10 11 12 |
invoicesIDSL := TStringList.Create; try if DBGrid.SelectedRows.Count > 0 then with DBGrid.DataSource.DataSet do for i := 0 to DBGrid.SelectedRows.Count - 1 do begin GotoBookmark(pointer(DBGrid.SelectedRows.Items[i])); invoicesIDSL.Add(FieldByName('id').AsInteger.ToString); end; finally invoicesIDSL.Free(); end; |