Dual-mode liquid crystal grating based on photo- and nanoparticle-induced alignment effects.