Sri Lanka were struggling at 69 for four before left-handed Sangakkara (75 not out) and Chandimal (53 not out) put on 106 for the unfinished fifth-wicket stand to steady the innings on the second day in Colombo.
Sangakkara, who scored a century in each innings of the drawn first Test in Galle, also completed 6,000 Test runs at home during his 173-ball knock.
Bangladesh, who struck three times in the morning session in the space of 30 runs to put Sri Lanka under pressure, went wicketless in the afternoon as Sangakkara and Chandimal applied themselves remarkably well.
The hosts added 157 runs to their overnight total of 18 for one.
Sangakkara played some aggressive shots, driving paceman Abul Hasan through the covers and then firmly cutting in the same over for two fours. He reached his half-century when he pulled off-spinner Sohag Gazi for a boundary.
Chandimal, who made a hundred in the last match, has so far hit four boundaries, including three in an over from Gazi.
Bangladesh dominated the first session as Abul, Robiul Islam and Gazi each took one wicket.
Dimuth Karunaratne added five to his overnight score of 12 before he was caught by wicket-keeper Mushfiqur Rahim off Abul while Lahiru Thirimanne was also caught behind, off paceman Robiul.
Thirimanne, who scored a century in the last match, failed to open his account this time.
Gazi put more pressure on Sri Lanka when he had skipper Angelo Mathews (16) caught by Mohammad Mahmudullah in the slips.
Sri Lanka’s left-arm spinner Rangana Herath on Saturday finished with five for 68 as Bangladesh were bowled out in the final session. Mominul Haque top-scored for the tourists with 64.
Brief Scores: Bangladesh 240 (Mominul Haque 64, Nasir Hossain 48; Rangana Herath 5 for 68) lead Sri Lanka 175 for 4 (Kumar Sangakkara 75*, Dinesh Chandimal 53*) by 65 runs