Autor Beitrag
Rool
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 211



BeitragVerfasst: Mi 11.06.03 13:07 
Ich will vorrübergehend die kompletten Items eines Listviews in eine Variable kopieren. Ein array zu nehmen funktioniert zwar einwandfrei, aber bei ca. 2500 Einträgen mit 7 Subitems und evtl. Data-Einträgen, dauert das ganze VIEL zu lange. Jetzt habe ich mir folgendes überlegt:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
var List:TListItems;

begin
 
List:=TListItems.Create(nil);    //<--Problem
List.Assign(lvwList.Items);
....

List.Free

Allerdings muss ich einen Owner (TListview) im constructor angeben. DAS WILL ICH ABER NICHT!
Kann mir da jemand weiterhelfen??

_________________
MFG Rool
Moritz M.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1672



BeitragVerfasst: Mi 11.06.03 15:10 
Das Problem ligt darin, dass TListItems VCL ist. Du brauchst also was, was keine Form benötigt. Da bietet sich TStringList an:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
var List:TStringList; 

begin 

List:=TStringList.create;
List.Assign(lvwList.Items); 
.... 

List.Free
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mi 11.06.03 15:21 
Onz hat folgendes geschrieben:
Da bietet sich TStringList an

Aber dann hast Du keinen Zugriff auf die Sub-Items.

Gru´ß
Tino
Rool Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 211



BeitragVerfasst: Mi 11.06.03 16:14 
Titel: ..
genau, falls das überhaupt geht!

_________________
MFG Rool
Moritz M.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1672



BeitragVerfasst: Mi 11.06.03 17:29 
Achso, braucht er SubItems... :oops:
Oops, einfach vergessen...