Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi StringGrid kopieren? (https://www.delphipraxis.net/107973-stringgrid-kopieren.html)

Code 5. Feb 2008 17:06


StringGrid kopieren?
 
Hallo Alle.

Wie kann man die Einträge von einem StrinGrid in einem andren StringGrit übertragen/kpoieren?

Gruß
Klaus

snow 5. Feb 2008 17:25

Re: StringGrid kopieren?
 
ne for schleife in einer for schleife, welche alle elemente kopiert.

gruß snow

FAlter 5. Feb 2008 17:59

Re: StringGrid kopieren?
 
Hi,

Zitat:

Zitat von snow
ne for schleife in einer for schleife, welche alle elemente kopiert.

eine einzelne Schleife reicht schon, wenn man Zeilenweise (Dest.Rows[I].Assign(Source.Rows[i])) oder Spaltenweise (dasselbe mit Cols statt Rows) tut.

Mfg
FAlter

Klaus01 5. Feb 2008 18:03

Re: StringGrid kopieren?
 
Delphi-Quellcode:
  for i:=0 to StringGrid1.RowCount -1 do
    StringGrid1.Rows[i].Assign(StringGrid2.Rows[i]);
Wenn man das so mach wie Felix das beschrieben hat, sollte sichergestellt sein, dass
die Anzahl der Zeilen indentisch sind.

Grüße
Klaus


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:46 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz