We present a novel multigrid-continuation method for treating parameter-dependent problems. The proposed algorithm which can be flexibly implemented is a generalization of the two-grid discretization schemes [C.-S. Chien, B.-W. Jeng, A two-grid discretization scheme for semilinear elliptic eigenvalue problems, SIAM J. Sci. Comput. 27 (2006) 1287–1304]. That is, approximating points on a solution curve do not necessarily lie on the same fine grid. We apply the algorithm to compute energy levels and superfluid densities of Bose–Einstein condensates (BEC) in a periodic potential. Both positive and negative scattering lengths are considered in our numerical experiments. For positive scattering length, if the chemical potential is large enough, and the domain is properly chosen, the results show that the number of peaks of the first few energy states of the 2D BEC in a periodic potential depends on the wave number of the periodic potential. Moreover, for bright solitons the number of peaks of the ground state solutions is ( 1 d − 1 ) 2 and ( 1 d ) 2 , where the periodic potential is expressed in terms of the sine or the cosine functions, respectively. However, these formulae do not hold if the scattering length is negative. The numerical study is extended to the two-component, 1D and 2D BEC in a periodic potential.