Autor Beitrag
Kalfany
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 26

Win 2000 SP4, XP SP2
D5 Enterprise, C# SharpDevelop, D2007 Enterprise
BeitragVerfasst: Di 19.02.08 14:39 
Hallo,

ich möchte aus einem mehrspaltigen ListView einen Eintrag in ein identisch aufgebautes ListView kopieren / verschieben

leider kopiert er mir immer nur die 2 Spalte?!

ausblenden Delphi-Quelltext
1:
LstViewDest.Items.AddItem(ListViewSrc.Items.Item[0],1);					


mit einspaltigen ListViews gehts.

Ich versteh auch das ich evtl. aufm Holzweg bin, nur was ich nicht kapier ist warum er bei Item[0] den Inhalt der 2 Spalte hat.
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Di 19.02.08 15:08 
Moin!

Probier das mal so: ;)
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.ListView1DblClick(Sender: TObject);
begin
  if Assigned(ListView1.Selected) then
    ListView2.Items.Add.Assign(ListView1.Selected);
//  ListView2.Items.Add.Assign(ListView1.Items.Item[0]);
end;

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Kalfany Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 26

Win 2000 SP4, XP SP2
D5 Enterprise, C# SharpDevelop, D2007 Enterprise
BeitragVerfasst: Di 19.02.08 15:44 
Hi,

danke so funktionierts!

Nur was ist wenn man es ohne die Selection machen möchte z.B. weil nicht selektiert ist oder weil z.B. weil man ein anderes als das selektierte verschieben möchte (muss ja auch irgendwie gehen)
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Di 19.02.08 15:58 
Moin!

user profile iconKalfany hat folgendes geschrieben:
danke so funktionierts!
Biite. ;)

user profile iconKalfany hat folgendes geschrieben:
Nur was ist wenn man es ohne die Selection machen möchte z.B. weil nicht selektiert ist oder weil z.B. weil man ein anderes als das selektierte verschieben möchte (muss ja auch irgendwie gehen)
Dir ist die zweite, auskommentierte Zeile aufgefallen? :les: :D

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Kalfany Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 26

Win 2000 SP4, XP SP2
D5 Enterprise, C# SharpDevelop, D2007 Enterprise
BeitragVerfasst: Di 19.02.08 16:21 
:autsch:

jetzt ja :D
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Di 19.02.08 16:42 
Moin!

Wenn dein Problem gelöst ist, markierst du den Thread dann noch entsprechend? Danke. ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.