Specifies the number of rows in the grid. 返回或者指定gird的行数stringgrid.RowCount: Longint;
procedure TForm1.FormCreate(Sender: TObject); var i:Integer; a:Integer; begin a:=0; for I:=1 to StringGrid1.RowCount-1 do begin if StringGrid1.Cells[1,i]<>'' then Inc(a); end; end;
for i:=0 to stringGrid.rowCount -1 do begin if Trim(StringGrid.Rows[i].Text) = '' then result := i; //返回空的一行,你可以从这行开始写数据 end;
返回或者指定gird的行数stringgrid.RowCount: Longint;
var
i:Integer;
a:Integer;
begin
a:=0;
for I:=1 to StringGrid1.RowCount-1 do
begin
if StringGrid1.Cells[1,i]<>'' then
Inc(a);
end;
end;
begin
if Trim(StringGrid.Rows[i].Text) = '' then
result := i; //返回空的一行,你可以从这行开始写数据
end;