Asalamu Alaikum,
Islam teaches us that actions are judged by intentions. If your intention in going to church is to be kind to and make your grandmother happy, then it stands to reason that this is a good deed since treating parents and grandparents well is a great deed in Islam. But we have to be careful about stepping into matters that Allah would consider shirk (associating partners with Him).
For example, if you are in church and the pastor or priest asks the congregation to kneel in front of the cross or for some other reason other than worshiping the one true God Who created all things, and you follow suit as a force of habit, then this is a serious issue. As a Muslim, you cannot worship, bow down to, or kneel to a cross, an idol, a man, or commit any other acts of shirk.
But if you go with your grandmother with good intentions and armed with caution and knowledge, then I don’t see any problem with it. However, I am by no means a scholar and my opinion is just an opinion. For a more definitive and accurate answer, I recommend that you send in your question to Ask the Scholar with details about your specific situation.
May Allah guide us to His truth and grant our loved ones guidance.
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.