The viologen-based compounds exhibit pronounced photochromic behavior upon generation of radicals, which makes them attractive and promising for applications in many areas. Herein, one Cd(II) coordination polymer constructed from cationic viologen-carboxylate ligand and sulfate ligands, formulated as {[Cd(cpbpy)(SO4) (H2O)](H2O)2}n (cpbpy = N-(3-carboxy(pyridin-2-yl))-4,4 '-bipyridinium) has been synthesized and structurally characterized. The compound exhibits a one-dimensional structure. Thermogravimetric analyses and powder Xray diffraction measurements demonstrate the good thermal and chemical stability of the compound. As expected, the crystalline sample could perform photochromic behavior upon UV irradiation, which should be attributed to photogenerated viologen radicals. According to the results of the crystallographic data and the density of states, the detailed electron donor and the pathways for electron transfer are clearly given. Interestingly, the powdered sample after mechanical grinding exhibits a different photochromic behavior. The phenomenon could be attributed to the mechanical grinding-induced slight structural changes, which affects the pathways for electron transfer. Moreover, the ability of inkless printing of powdered sample is discussed.