Firstly, do everything in your own power to keep things at least civil. Aim for friendly and light if you can. Even if your ex doesn't seem open to this. Take the high road here, which I know will be difficult. Don't ignore your ex. Simply attempt to be civil, friendly if you are able to manage. If at any time you are with your ex during the functions simply aim to treat him as friendly as possible. If you absolutely have to aim to treat him as any acquaintance you don't know very well. Be nice. Be civil. Be cordial. Try to keep it from getting awkward.
Try and include your ex, or at least attempt to find a way to share the time between the two of you. I know it's difficult to accomplish this. Trust me, I know. I also fail miserably with this. Try and offer your ex to spend time to your child(ren), essentially trading space with one another. Perhaps if you have more than one child you could trade off at some point. You spend time with your oldest, while he spends time with your youngest. Then at some point, some how you swap places. That way you are both able to spend time with each of your children.
I know it's not fun. I know it isn't the ideal situation, however, it is possible to survive shared school functions with your ex. It simply takes a little work and, unfortunately, a whole lot of self restraint.
Love & Support,