Extensive experiments on rats have shown that environmental cues play an important role in goal locating and navigation. Major studies about locating and navigation are carried out based only on place cells. Nevertheless, it is known that navigation may also rely on grid cells. Therefore, we model locating and navigation based on both, thus developing a novel grid-cell model, from which firing fields of grid cells can be obtained. We found a continuous-time dynamic system to describe learning and direction selection. In our simulation experiment, according to the results from physiology experiments, we successfully rebuild place fields of place cells and firing fields of grid cells. We analyzed the factors affecting the locating accuracy. Results show that the learning rate, firing threshold and cell number can influence the outcomes from various tasks. We used our system model to perform a goal navigation task and showed that paths that are changed for every run in one experiment converged to a stable one after several runs.