An Electrooptically Controlled Liquid-Crystal Diffraction Grating