Wa`alaykum as-salam wa rahmatullahi wa barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
Zakat Al-Fitr is obligatory on all Muslims who are alive when the sun sets on the night of Eid. It is not obligatory on one who died before this time. But it becomes due on one who died after sunset of the last day of fasting, which is the night of Eid. If in this case, the deceased did not pay Zakat Al-Fitr, then his or her relatives have to pay it from his or her wealth on his or her behalf.
In his response to your question, Sheikh Muhammmad S. Al-Munajjid, a prominent Saudi Muslim lecturer and author, states:
It is only required from the living who are present at the time when it becomes due. Zakat Al-Fitr becomes due when the sun sets on the last day of Ramadan, because the Prophet (peace and blessings be upon him) called it Sadaqat Al-Fitr, and fitr (Arabic for: breaking the fast of Ramadan) comes when the sun sets on the night of `Eid (i.e. the night before Eid). It purifies the fasting person from any idle or obscene speech, and the fast ends when the sun sets.
If a person dies before the time it becomes obligatory, he or she does not have to pay this zakah. If a person lives until the time when it becomes obligatory then dies before paying it, then it should be paid on his or her behalf from his or her wealth because it is still a duty that he or she owes and becomes a debt that must be paid on his or her behalf (Al-Majmu`, 6/84; Al-Mughni, 2/358; Al-Mawsu`ah Al-Fiqhiyyah, 23/341).
Sheikh Ibn `Uthaymeen, a prominent Saudi scholar (may Allah have mercy upon him) said, “If a person dies before the sun sets on the night before Eid, he or she does not have to pay Zakat Al-Fitr, because he or she died before it became obligatory.”
In conclusion, the deceased or to be more accurate his or her inheritors are required to pay this zakah if death happened after the time when it became obligatory, which is sunset on the night before Eid. In that case, it must be paid on his behalf.
If he or she died before the time when it became obligatory, which appears to be the case in the question asked here, then this zakah is not obligatory.
If your grandmother gave charity (such as food and money) on this person’s behalf, then it is considered charity given on his behalf and is not Zakat Al-Fitr.
It is proven in more than one hadith of the Prophet (peace and blessings be upon him) that charity given on behalf of the dead benefits them and the reward reaches them.
Allah Almighty knows best.