Gridding is the first, essential stage of processing cDNA microarray images. The existing tools for allocating the grid structure in a microarray image often require human intervention which causes variations to the gene expression results. In this paper, an original and fully-automatic approach to gridding microarray images is presented. The proposed approach is based on a Genetic Algorithm which determines parallel and equidistant line-segments constituting the grid structure. Thereafter, a refinement procedure follows which further improves the existing grid structure, by slightly modifying the line-segments. Experiments on 16-bit microarray images have shown that the proposed method is effective as well as noise-resistant. Additionally, it achieves an accuracy of more than 95% and it outperforms existing methods.