I'll still be polite and hi if he should come up to me. But if I spot him first and he doesn't notice me, I usually exit the scene quick because I could careless. I have a funny story to share.
One guy I use to date saw me at a fundraising party one time so many years back, he got married though by the way, my cousins and I went to the food bar to bring food back to our table. The second trip back up to the food bar, I noticed him standing there to the side talking on his cellphone, plugging his ear with his other finger as to block out the noise. As we got the plates of appetizers and drinks, he flipped off his phone and said in a suprised tone "Ehh...oh my goodness look at you..." I just gave him a weird look under dark eyes and a soured look, thinking to myself "Okay? Uh your wife is over there.." My cousins went back to our table as I stood there alone. I didn't want to be rude so I smiled and said "Hey, how are you? You guys are here too?" As he was starting to speak, I cut him off halfway and said "Hey I gotta get back, but hope you're good." I just walked away and went back to join my party. But through out the night, or whenever I got up to go the bathroom or walk around the hall, I caught him keep glancing my way.
Why do guys do this?! When you're married, why do you still want to talk or wonder how an exgf is doing? We don't care how you're living anymore, seriously. Be faithful to your wife and don't try to make a scene or get your wife jealous if you should see an ex out in public.