First, children are not property. They are not "given away." A parent can designate a guardian of minor children, both physical custody and who is to take care of the money. They do not have to be the same person.
Unless the other parent has had their parental rights terminated, custody of the children will go to the other parent regardless of what the now deceased parent said.
The maternal grandmother will not have a say in it.
You can do it but it does not mean that it will happen if you die. The other parent's rights are superior to anyone else on the planet. You probably want to sit down in person with a family law attorney and discuss your options.
In the past, I have added a third party as an additional conservator in a modification by a Judge when the mother was ill and was probably going to die. In my cases, dad was "missing" and not an option to take the children upon mom's death. It was an unusual step, but in my cases and with preparing the judge with the facts, we were able to get it done. If this is your case, then you will need an experienced and knowledgeable family law attorney to help you. Don't hire a newly licensed attorney that has never done an unusual case like this before - you need someone that's been around awhile to handle a case like this and that knows the judge and can "gently prepare" the judge for your unusual situation.
Fran Brochstein has over 20 years legal experience & enjoys educating people about Texas laws and mediation. She has a full-time family law mediation practice in the Houston area. She will do face-to-face one-time consultations for $175/hour -- if you mention that you saw this special price on avvo.
If you found this answer "helpful" or "best answer", please select the button to show your appreciation. Please understand that Fran Brochstein's reply to your question in no way creates an attorney-client relationship. You are strongly encouraged to consult with an attorney in your county in person about your specific legal problem.
You can contact her at 713-805-9591 - 7 days a week on her personal cell phone.
The custodial parent can put that in a will, but it will not necessarily be what is done. The other parent has a greater right than anyone else to have custody of the child and becomes the custodial parent on the death of the other parent (unless the other parent's parental rights were terminated in a court proceeding). If the surviving parent prefers the children live with the grandparent, then a "friendly" lawsuit would be filed by the grandparent asking for custody. The final order would state grandparent is the conservator (has custody) and the surviving parent has whatever visitation that parent and the grandparent agree to. Child support would usually be ordered as well.
I recommend that you consult with an attorney regarding this matter.