Lattice effect on the charge-ordering transition of doped manganites