The inheritance as soon as the deceased passes on is the right of the heirs. If the deceased requested a portion of his wealth for an ongoing charity it is compulsory for the heirs to fulfill the wish without spending more than one-third of the whole property. If he did not leave such in his will and the heirs wish to make an ongoing charity for him, it can be done after sharing the inheritance.
However, it is also permissible for the inheritors to agree on allocating a particular amount on behalf of the deceased from the wealth left before sharing it, for the purpose of an ongoing charity for him. Hence, they can share the remaining property among themselves based on the Islamic law of inheritance.