Why are X-rays not diffracted by diffraction grating or thin films?
Diffraction is the spreading out of a wave when it passes through a small opening or around an obstacle. The amount of diffraction depends on the wavelength of the wave and the size of the opening or obstacle.
For X-rays, the wavelength is so short that they are not diffracted by most objects. The openings or obstacles would need to be extremely small, on the order of a few nanometers, in order to diffract X-rays. This is why X-rays are not diffracted by diffraction gratings or thin films.
However, X-rays can be diffracted by crystals. Crystals have a regular arrangement of atoms, and the spacing between the atoms is on the same order of magnitude as the wavelength of X-rays. This means that X-rays can be diffracted by the atoms in a crystal, and this diffraction can be used to determine the structure of the crystal.