Einzelnen Beitrag anzeigen

Benutzerbild von Sharky
Sharky

Registriert seit: 29. Mai 2002
Ort: Frankfurt
8.251 Beiträge
 
Delphi 2006 Professional
 

Re: Stringgrid spät anzeigen bzw. füllen

  Alt 13. Dez 2004, 07:11
Hai Hansa,

hast Du es schon einmal mit BeginUpdate / EndUpdate versucht? Das sollte man beim einfügen von großen Datenmengen immer verwenden.

Delphi-Quellcode:
procedure SGBeginUpdate (sg : TStringGrid);
var
  ndx : Integer;
begin
  for ndx := 0 to sg.RowCount-1 do
  begin
    sg.Rows[ndx].BeginUpdate;
  end;
  for ndx := 0 to sg.ColCount -1 do
  begin
    sg.Cols[ndx].BeginUpdate;
  end;
end;

procedure SGEndUpdate (sg : TStringGrid);
var
  ndx : Integer;
begin
  for ndx := 0 to sg.RowCount-1 do
  begin
    sg.Rows[ndx].EndUpdate;
  end;
  for ndx := 0 to sg.ColCount -1 do
  begin
    sg.Cols[ndx].EndUpdate;
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
   SGBeginUpdate(StringGrid1);
   // Füllen des StringGrids mit Daten
   SGEndUpdate(StringGrid1);
end;
Stephan B.
"Lasst den Gänsen ihre Füßchen"
  Mit Zitat antworten Zitat