The London-based Da`iyah, Zienab Mostafa, states the following:  it is not haram to choose the gender of the child as long as we maintain the halal medical procedures. There are some reservations against doing this procedure to prevent having a certain gender the family does not like, because it is similar to the behaviour and customs of the jahiliyyah (the pre-Islamic era of ignorance). Another scholar, Dr. Ujail An-Nashmi of the Kuwait, adds that it does not contradict the Islamic faith to choose the gender of the embryo because the Muslims believe in the will of Allah after all.
As for my opinion, I deeply respect our great scholars, but I prefer to leave the matter to the choice of Allah, which is always the best for everyone. We don’t know about the medical hazards involved in that procedure; they could result in producing a defected or unhealthy boy/girl.
May Allah give us the mercy to be constant in accepting His fate.