Dielectrophoretic forces originating from highly modulated electric fields can be used to trap particles on surfaces. An all-optical way to induce such fields is the use of a photorefractive material, where the fields that modulate the refractive index are present at the surface. We present a method for two-dimensional particle alignment on an optically structured photorefractive lithium niobate crystal. The structuring is done using an amplitude-modulating spatial light modulator and laser illumination. We demonstrate trapping of uncharged graphite particles in periodic and arbitrary patterns and provide a discussion of the limitations and the necessary boundary conditions for maximum trapping efficiency. The photorefractive crystal is utilized as bottom part of a PDMS channel in order to demonstrate two-dimensional dielectrophoretic trapping in a microfluidic system.