Cody could tell that Karli wasn't terribly happy after she caught Claire's bouquet because of the look on her face and the fact that she was twisting the pearl stud earrings she always wore around and around. She only did that when she was upset.
That was why he asked her to dance. She had been looking out at the dance floor all this time. It seemed like she wanted to be out there since almost everyone else here was.
She livened up a bit once they were out there, especially once he copied something he saw Steve do with his wife and twirled her under his arm. That made her laugh in delight, which eased his stress somewhat.
It was strange seeing Steve outside of his office but he had been at that pre-wedding party one of Alex's coworkers threw as well. He gave no indication that he knew him aside from saying hi and generically asking how he was doing like any other outsider when they saw an acquaintance.