What you are encountering is Activation Lock or related to it. This is a security feature, in part to deter re-selling of stolen devices. Click on the link to read more about 'Activation Lock for iPhone, iPad, and iPod touch' --> http://support.apple.com/HT201365
An activation lock can only be removed using information for the account that applied the lock. If you know this information follow the onscreen steps to enter the Apple ID and password used to set up the device, or enter the device passcode. Click on this link to learn 'How to remove Activation Lock' --> https://support.apple.com/HT201441
If the required information is not known, the official owner of the deceased person's things as can be proven by documentation needs to try one of these things:
Read this link to discover "How to request access to a deceased family member's Apple accounts" [and devices] - https://support.apple.com/HT208510
OR
- Apple can remove a lock if a person can provide sufficient evidence of valid ownership. Do this online here --> https://al-support.apple.com/#/additional-support Apple says, "Proof of ownership documentation is required," but does not state what constitutes proof. This might be similar to what is required in the previous section.
My concern is when you say this was a secondhand iPhone to him. This may make it very difficult to get Apple to unlock the iPhone unless your grandfather had documentation such as the original receipt.
I highly doubt there is anything you can do "internally" to render this phone usable to you. If it were that easy then there would be no point to Apple having the Activation Lock feature.