Visiting the graves is a Sunnah of the Prophet (peace be upon him). He said, “Earlier, I had forbidden you from visiting graves; now you can do it for it may remind you of the Hereafter.”
The Prophet further said, “The deceased would know who visit them; they will return the greeting of those who greet them.”
Having said this, I should point out that Eid is a time of celebration and joy. So, if by visiting the graves one would not be able to be true to the spirit of celebration it may be better to avoid it; if that is not the case, and by visiting the deceased, he is merely remembering them on the occasion of their joy that is fine. In that case, it would be even better.
However, at all times, one must shun all forms of wailing and lamentations. If there is a fear of indulging in them, then one should avoid such visits altogether.
Allah Almighty knows best.
Views expressed by hosts/guests on this program (live dialogue, Facebook sessions, etc.) are their own and their appearance on the program does not imply an endorsement of them or any entity they represent.