If the cell borders have been manually formatted, then the toggle for gridlines will only affect the cells without manual border formatting.