There is no harm in offering condolences to the bereaved family in the graveyard, whether before or after the burial. As for the practices mentioned in the question, that the
neighbors of the bereaved family invite them to eat with them in turn, in addition to erecting marquees, bringing people to recite the Qur'an, whether in return for fees or for free, and holding a banquet after forty days pass, all this is groundless in Shari`ah; moreover, it is even a Bid`ah (innovation in religion), as the Prophet (peace be upon him) said,
Anyone who introduces anything into this matter of ours (Islam) that is not part of it will have it rejected.
Preparing food by the bereaved family is one of the practices of the people of Jahiliyyah (pre-Islamic time of ignorance). Thus, it should not be done. What is permissible is to prepare food for the bereaved family and send it to them; not inviting them to it, as the Prophet (peace be upon him) said,
Ja`far (may Allah be pleased with him) was killed in the Battle of Mu'tah, he said to his family, "Prepare food for the family of
Ja`far for they are too grieved to think of food now."
(Part No. 9; Page No. 137) May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.