int iRowIndex = 0;
int iColIndex = event.getIndex();
List<CellValue< ? extends Comparable< ? >>> columnData = event.getColumnData();
for ( int iRow = 0; iRow < data.size(); iRow++ ) {
DynamicDataRow row = data.get( iRow );
CellValue< ? extends Comparable< ? >> cell = columnData.get( iRowIndex );
if ( row instanceof GroupedDynamicDataRow ) {
GroupedDynamicDataRow groupedRow = (GroupedDynamicDataRow) row;
//Setting value on a GroupedCellValue causes all children to assume the same value
groupedRow.get( iColIndex ).setValue( cell.getValue() );
//So set the children's values accordingly
for ( int iGroupedRow = 0; iGroupedRow < groupedRow.getChildRows().size(); iGroupedRow++ ) {
cell = columnData.get( iRowIndex );
groupedRow.getChildRows().get( iGroupedRow ).get( iColIndex ).setValue( cell.getValue() );
iRowIndex++;
}
} else {
row.get( iColIndex ).setValue( cell.getValue() );
iRowIndex++;
}
}
data.assertModelMerging();