We discuss the applicability of holographically recorded gratings in photopolymers and holographic polymer-dispersed liquid crystals as neutron optical elements. An experimental investigation of their properties for light and neutrons with different grating spacings and grating thicknesses is performed. The angular dependencies of the diffraction efficiencies for those gratings are interpreted in terms of a rigourous coupled wave analysis. Starting from the obtained results we work out the lines for the production of an optimised neutron optical diffraction grating, i.e., high diffraction efficiency in the Bragg diffraction regime with moderate angular selectivity.