The Smith–Purcell radiation produced by electrons moving closely to a grating can be enhanced by resonances. Here, we show a method to manipulate the directionality of the resonance-enhanced radiation. Using the rigorous coupled-wave analysis method, we compare the radiation from symmetric and asymmetric gratings, showing that the enhanced Smith–Purcell radiation can become unilateral with a perturbation that breaks the structural symmetry. Our work provides an effective method for frequency-domain calculation of Smith–Purcell radiation and also an approach to realize more efficient use of the radiation.