I have add new method (will be ready for 3.2) in NextGrid ideal for small grids and testings:
CODE
procedure AddCells(ACells: array of WideString);
Example how to use it:
1) Create new NextGrid and add 2 columns
2) Place one Button and add next code for OnClick:
CODE
NextGrid1.AddCells(['one', 'two', 'three', 'four', 'five', 'six']);
3) Run program and click on button.
You will see that this method automaticaly create rows and add next element of array into next cell.
This method will be available in v3.2. If you have some comments about this feature, or you have idea how to improve it, we can talk here.
If someone like to use it in current version, here is a code:
CODE
procedure TNextGrid.AddCells(ACells: array of WideString);
var
I, Col: Integer;
begin
AddRow;
I := 0;
while I < Length(ACells) do
begin
for Col := 0 to Columns.Count - 1 do
begin
Cells[Col, RowCount - 1] := ACells[I];
Inc(I);
end;
if I < Length(ACells) then AddRow;
end;
end;
var
I, Col: Integer;
begin
AddRow;
I := 0;
while I < Length(ACells) do
begin
for Col := 0 to Columns.Count - 1 do
begin
Cells[Col, RowCount - 1] := ACells[I];
Inc(I);
end;
if I < Length(ACells) then AddRow;
end;
end;
regards