Controllable electromagnetically induced grating in a cascade-type atomic system