void (final RadContainer grid, final int cellIndex, final boolean isRow) { check(grid, isRow, cellIndex); if (canDeleteCell(grid, cellIndex, isRow) == CellStatus.Required) { throw new IllegalArgumentException("cell cannot be deleted"); } final RadAbstractGridLayoutManager oldLayout = grid.getGridLayoutManager(); final LayoutManager newLayout = oldLayout.copyLayout(grid.getLayout(), isRow ? -1 : 0, isRow ? 0 : -1); GridConstraints[] oldConstraints = copyConstraints(grid); for (int i=grid.getComponentCount() - 1; i >= 0; i--){ final GridConstraints constraints = grid.getComponent(i).getConstraints(); if (constraints.getCell(isRow) > cellIndex) { // component starts after the cell being deleted - move it addToCell(constraints, isRow, -1); } else if (isCellInsideComponent(constraints, isRow, cellIndex)) { // component belongs to the cell being deleted - decrement component's span addToSpan(constraints, isRow, -1); } } grid.setLayout(newLayout); fireAllConstraintsChanged(grid, oldConstraints); }