just spit balling here but could you use Linq to sort the objects? Create a list of the actual point entities then sort them.
something like:
var sortedPointsList = pointsList.OrderBy(p => p.X).ThenBy(p => p.Y);
then foreach over the new list to add your numbering?