We have investigated ballistic magnetoresistance effects in a two dimensional electron gas subjected to a periodic magnetic field that alternates in sign. The magnetic field was produced by a submicron ferromagnetic grating, made of either nickel or cobalt stripes, which was fabricated at the surface of the heterostructure. We observe giant magnetoresistance effects due to the channelling of electrons along lines of zero magnetic field orientated perpendicular to the current. Our semiclassical model accounts in great detail for all features in the magnetoresistance.