This is most likely a newbie question: In the NextGrid HOWTO, I see that it has a AddCells() method which apparently fills the grid in one go, so as to avoid calling AddRows() followed by a double For loop (to go through each row, and each column).
I'd like to know how to use this method when the data is in a dataset:
CODE
//Create StringList to host array "SQL name = User-friendly name", and add columns
MySL := TStringList.Create;
MySL.CommaText := 'id=Identification, label=Label';
for index := 0 to MySL.Count - 1 do begin
NextGrid1.Columns.Add(TNxTextColumn,MySL.ValueFromIndex[index]);
end;
With ASQLite3Query1 do begin
SQL.Text := 'SELECT id,label FROM mytable';
Open;
//How to fill grid with AddCells?
//E2250 There is no overloaded version of 'AddCells' that can be called with these arguments
NextGrid1.AddCells(ASQLite3Query1.Fields);
end;
FreeAndNil(MySL);
MySL := TStringList.Create;
MySL.CommaText := 'id=Identification, label=Label';
for index := 0 to MySL.Count - 1 do begin
NextGrid1.Columns.Add(TNxTextColumn,MySL.ValueFromIndex[index]);
end;
With ASQLite3Query1 do begin
SQL.Text := 'SELECT id,label FROM mytable';
Open;
//How to fill grid with AddCells?
//E2250 There is no overloaded version of 'AddCells' that can be called with these arguments
NextGrid1.AddCells(ASQLite3Query1.Fields);
end;
FreeAndNil(MySL);
Thank you.