Einzelnen Beitrag anzeigen

Popov
(Gast)

n/a Beiträge
 
#4

AW: Stringgrid Zeilen füllen

  Alt 1. Dez 2012, 21:04
Sollte beides kein Problem sein. Problem liegt evtl. wo anders.

//Edit:

Ich hab es gerade noch mal getestet, bei mir funktioniert beides in etwa ähnlich

Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
type
  Txyarray = record
    bezeichnung: string;
  end;
var
  xyarray: array[1..100] of Txyarray;
  zeile, zaehler: Integer;
begin
  for zaehler := low(xyarray) to high(xyarray) do
    xyarray[zaehler].bezeichnung := IntToStr(zaehler);

{  zeile := 0; tabelle.rowcount := 2;
  for zaehler := low(xyarray) to high(xyarray) do
  begin
    inc(zeile);
    tabelle.cells[1,zeile] := xyarray[zaehler].bezeichnung;
  end;
  tabelle.rowcount := length(xyarray);   }


  zeile := 0; tabelle.rowcount := 2;
  for zaehler := low(xyarray) to high(xyarray) do
  begin
    inc(zeile);
    tabelle.rowcount := tabelle.rowcount + 1;
    tabelle.cells[1,zeile] := xyarray[zaehler].bezeichnung;
  end;
end;

Geändert von Popov ( 1. Dez 2012 um 21:09 Uhr)
  Mit Zitat antworten Zitat