First and foremost, I would advice that you try to keep your mind off him for some time and view the occurence as one of those things,especially one that you cannot change.Though , it maybe difficult since you will still be seeing him once in a while.But,not to worry it's not impossible. If you have the upper hand in whatever brings you together with him, you may avoid him for some time. You should also know that this is a big lesson and guide to you for future relationship.
I would also want you to note that most of these problems are caused by lack of peoples' inability to get their relationship right from beginning.The main reason for this is their overloking some basic relationship compatibility issues that should not have been overlooked.
Take heart, try to forget about him and move on...Enjoy yourself today