Who was Lord Krishna's grandfather

Did Lord Krishna take Avatar when sons of Shatrughna were king of Mathura?

Sons of Ramah and their kingdom

Kusha (Kusi) and Luva (Lava)

Uttara Kanda from Ramayana

The intelligent Rama raised the sprawling city of Kusavati at the foot of the Vindhya Mountains for Kusha.

The city of Sravanti was raised for lava.

The mighty auto warriors Rama and Bharata, who desert Ayodhya, have turned to preparation for heaven.

Sons of Bharata and their kingdom

Taksha and Pushkala

Uttara Kanda from Ramayana

Bharata placed Taksha in Takshasila and Pushkala in Pushkalavati.

Sons of Lakshmana and their kingdom

Angada and Chandraketu

Uttara Kanda from Ramayana

The beautiful land of Chandra dyuti is the kingdom of Chandraketu, and after subjugating the land of Karupada there was Angada.

Sons of Shatrughna and their kingdom

Shatrughati (Satrughati) and Subahu (Suvahu)

Uttara Kanda from Ramayana

Suvahu was put on the throne of Mathura and Satrughati became the king of Vidisha.

Did Lord Krishna take Avatar when sons of Shatrughna were king of Mathura?

No, please see the explanation here:

Ramayana ➡ Mahabharata: 31 Ikshvaku kings, how old were these kings (average)?

Kansa (or Kamsa) was king of Mathura when Lord Shri Krishna incarnated. Before that, Ugrasena was King of Mathura. Shurasena (grandfather of Lord Shri Krishna) was king of Mathura before Ugrasena. When Lord Shri Krishna killed Kansa, Ugrasena became king of Mathura again.

Is Mathura (in which Lord Shri Krishna is incarnated) the same city where Shatrughna ruled?

Yes, please note the following explanation:

In Madhuvana used to live a demon named Madhu. Kumbhinasi was born to Ravana's maternal aunt Anala. Madhu was Kumbhinasi's husband. Later Madhu's son, the sinful Lavana, began to live there. (Uttara Kanda from Ramayana)

Lavana received a trident from his father, which Lord Shiva Madhu had previously given. Nobody could kill Lavana with that trident. Mandhata (one of the most powerful kings of Rama's ancestors) was killed by Lavana. (Uttara Kanda from Ramayana)

Shatrughana later challenged Lavana while not wearing this trident and killed him. (Uttara Kanda from Ramayana)

On the orders of Lord Shri Rama founded Shatrughana a city on the banks of the Yamuna River, which is known as Madhura or Mathura. This city on the banks of Yamuna looked beautiful as the crescent moon and was full of courtyards, shops, streets, beautiful houses, men of four orders and various merchandise. (Uttara Kanda from Ramayana)

Sarvabhouma

Instead of just adding "source", it would be helpful if users knew where the story came from, e.g. E.g .: Uttara Kanda from Ramayana or another. Links will be dead one day. Remember that you need to copy pasted text in quotation marks. Block quotations should not be used for your own sentences or for circumscribed sentences. You do it differently.

YDS

@NogShine I didn't use block quotes for my own sentences.

Sarvabhouma

Well, there is one other answer that you gave. hinduism.stackexchange.com/a/22525/5212. Please edit both answers. Use block quotations to copy pasted information that is not needed for your words. That's all of me.