The tourists, replying to Sri Lanka's first innings total of 183, took their overnight score of 128-2 to 227 without further loss by lunch on the second day.
Left-handed opener Dhawan was unbeaten on 110, his fourth Test century in 15 matches, and skipper Kohli returned to form with 86 not out as the pitch eased under the hot sun.
The pair have so far put on 199 runs for the third wicket in a fine partnership after India were reduced to 28-2 after tea on the first day.
India will resume after lunch with a lead of 44 runs and eight wickets in hand, looking to build a sizeable total in the first match of the three-Test series.
Dhawan, who was on 53 overnight, reached the three-figure mark 20 minutes before lunch by driving fast bowler Dhammika Prasad through the covers for his 10th boundary.
But Dhawan was lucky to survive a loud appeal for leg-before against off-spinner Tharindu Kaushal when he was on 79.
Replays showed the ball pitched in line and would have gone on to hit the stumps, but since the Decision Review System is not being used in the series, umpire Bruce Oxenford's decision stood.
Lahiru Thirimanne, who led Sri Lanka in the absence of the indisposed Angelo Mathews, rotated his four bowlers in short spells but failed to achieve the breakthrough in the session.
On Wednesday, India's off-spinner Ravichandran Ashwin claimed six wickets and leg-spinner Amit Mishra took two as the hosts were dismissed in 49.4 overs after electing to bat. – AFP
Original source: India in control against SL