Direction switching and beam steering of cholesteric liquid crystal gratings