Autor Beitrag
pepsen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 51



BeitragVerfasst: Mi 08.11.06 11:19 
Guten Morgen!
gibt es eine Methode mit der ich den Inhalt aller Zellen eines Stringgrids löschen kann?
Irgendwie find ich da nichts!

MfG Pepsen
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6393
Erhaltene Danke: 147

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mi 08.11.06 11:36 
Ich würde RowCount einfach soweit wie möglich runtersetzen.
Für die übrig gebliebenen Zeilen sollte dann ein StringGrid1.Rows[i].Clear; genügen. Das ganze für die restlichen Zeilen natürlich in einer Schleife.
gbst51sc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 56

Windows XP
Delphi 7.0 Enterprise, Delphi 2005 Personal
BeitragVerfasst: Mi 08.11.06 11:51 
Warum RowCount runtersetzen?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
var i,j: Integer;
begin

for i:=0 to Stringgrid1.RowCount-1 do
    for j:=0 to Stringgrid1.ColCount-1 do
        Stringgrid1.Cells[j,i]:='';


oder:

ausblenden Delphi-Quelltext
1:
2:
for i:=0 to Stringgrid1.RowCount-1 do
    Stringgrid1.Rows[i].clear;
pepsen Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 51



BeitragVerfasst: Mi 08.11.06 11:52 
danke dir/euch...
is ja scho fast peinlich...so einfach, wie es ist!
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6393
Erhaltene Danke: 147

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mi 08.11.06 11:54 
user profile icongbst51sc hat folgendes geschrieben:
Warum RowCount runtersetzen?
Optimierung?
pepsen Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 51



BeitragVerfasst: Mi 08.11.06 12:02 
dies benötige ich nich, da ich die Zellen gleich wieder neu beschreibe!
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6393
Erhaltene Danke: 147

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mi 08.11.06 12:06 
Dann ist Ronnys Lösung die bessere.
pepsen Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 51



BeitragVerfasst: Mi 08.11.06 12:28 
jop...die hab ich auch angewendet! Aber auch scho, bevor ich seine Nachricht gelesen hatte ;o) Mir hat eigentlich nur das rows[i].clear; gefehlt!