Can't programmatically expand all records

We are using SmartGWT build 2.4.2011.04.08

We want to expand all records in a grid. ( open all records to show the embadded components in a ListGrid ), but I can only open one record programmatically ( the last record ). calling setCanExpandMultipleRecords(Boolean.TRUE) does not seem to work.

Sample code:

public class MyListGrid extends ListGrid {

…

public void expandAllRecord() {
setCanExpandMultipleRecords(Boolean.TRUE);
if ((getRecords() != null) && (getRecords().length > 0)) {
for (ListGridRecord gridRecord : getRecords()) {
expandRecord(gridRecord);
}
}
addDataArrivedHandler(new DataArrivedHandler() {

  @Override
  public void onDataArrived(DataArrivedEvent event) {
    int startRow = event.getStartRow();
    int endRow = event.getEndRow();
    
    for (int i = startRow; i < endRow; i++) {
      expandRecord(getRecord(i));
    }
  }
});

}
}

If you want to expand all records in a grid, use the recordComponents subsystem instead of expanding records. See the ListGrid documentation of showRecordComponents.