Multichannel detection using transmissive diffraction grating sensor