TAdvStringGrid versus looping rows

How do I loop all rows in a TAdvStringGrid even when the rows are not visible because they are grouped and not expanded?

Thank you in advance for your response.

The code below only loops the visible cells.

String sResult;
for(int i=0; i<AdvStringGrid1->RowCount; i++)
  {
    sResult = sResult + AdvStringGrid1->Cells[1][ i ] + " = " + AdvStringGrid1->Cells[2][ i ] + "\r\n";
  }
ShowMessage(sResult);


for i := 0 to grid.TotalRowCount - 1 do

begin
  sResult := sResult + grid.AllCells[col,i];
end;