Added support for orientation change keeping the grid selection