private void populateActivitiesGrid(PlinthWorkActivitiesVoCollection voActivitiesColl) { if(voActivitiesColl!= null) { GenForm.grdPositionRow row; for(int y=0; y<voActivitiesColl.size(); y++) { PlinthWorkActivitiesVo voAct = voActivitiesColl.get(y); int p =0; for(p=0; p<form.grdPosition().getRows().size(); p++) { row = form.grdPosition().getRows().get(p); if(row.getColPosition().equals(voAct.getPosition())) { row.setColPosition(voAct.getPosition()); row.setColActivity(voAct.getActivity()); break; } } if(p == form.grdPosition().getRows().size()) { row = form.grdPosition().getRows().newRow(); row.setValue(voAct); row.setColPosition(voAct.getPosition()); row.setColActivity(voAct.getActivity()); } } } }