Switchable Diffraction Gratings Based on Inversion of the Dielectric Anisotropy in Nematic Liquid Crystals