The solution of the Enskog equation for the one-body velocity distribution of a moderately dense arbitrary mixture of inelastic hard spheres undergoing planar shear flow is described. A generalization of the Grad moment method, implemented by means of a novel generating function technique, is used so as to avoid any assumptions concerning the size of the shear rate. The result is illustrated by using it to calculate the pressure, normal stresses, and shear viscosity of a model polydisperse granular fluid in which grain size, mass, and coefficient of restitution vary among the grains. The results are compared to a numerical solution of the Enskog equation as well as molecular-dynamics simulations. Most bulk properties are well described by the Enskog theory and it is shown that the generalized moment method is more accurate than the simple (Grad) moment method. However, the description of the distribution of temperatures in the mixture predicted by Enskog theory does not compare well to simulation, even at relatively modest densities.