GridInsertLocation () { final RadAbstractGridLayoutManager gridManager = myContainer.getGridLayoutManager(); if (myMode == GridInsertMode.RowBefore && myRow > 0) { myMode = GridInsertMode.RowAfter; myRow--; } else if (myMode == GridInsertMode.ColumnBefore && myColumn > 0) { myMode = GridInsertMode.ColumnAfter; myColumn--; } if (myMode == GridInsertMode.RowAfter && gridManager.isGapCell(myContainer, true, myRow)) { myRow--; } else if (myMode == GridInsertMode.RowBefore && gridManager.isGapCell(myContainer, true, myRow)) { myRow++; } else if (myMode == GridInsertMode.ColumnAfter && gridManager.isGapCell(myContainer, false, myColumn)) { myColumn--; } else if (myMode == GridInsertMode.ColumnBefore && gridManager.isGapCell(myContainer, false, myColumn)) { myColumn++; } return this; }