One day,my uncle told me that King Bhagirath was an ancestor of Lord Rama's father King Dasharath. Is this true or false?
What you heard is true; King Bhagiratha was an ancestor of Dasharatha and Sri Rama. In Bala Kanda (Chapter 70), of Valmiki Ramayana, Rama's line of descent is spelled out in great detail by Sage Vashishta. This was right before Sita's wedding to Rama in Mithila. I've referenced below the relevant part that answers your question.
From Sagara it is Asamanja and from Asamanja it is Amshuman, and from Amshuman it is Diliipa, and the son of Diliipa is Bhageeratha... [1-70-38]
From Bhageeratha it is Kakutstha, from Kakutstha it is Raghu, and Raghu's son is the great resplendent Pravriddha, who is reduced to a human flesh eater, and he is also known as Kalmashapaada... and from him, that Pravriddha, Shankana is born... [1-70-39, 40a]
Shankana's son is Sudarshana, and from Sudarshana it is Agnivarsna... And Shiigraga is the son of Agnivarsna, and Shiighraga's son is Maru and from Maru it is Prashushruka, and Ambariisha is the son of Prashushruka... [1-70-41]
Ambariisha's son was Nahusha, the emperor and Yayaati is the son of Nahusha, but Naabhaaga is born to Yayaati... [1-70-42]
Aja was Naabhaaga's son and from Aja, this Dasharatha is manifest, and from him, from this Dasharatha, these brothers, Rama and Lakshmana are born... [1-70-43]
Vashishta, towards the end of Ayodhya Kanda and in a completely different setting than before, recites Rama's ancestry again. Here, he's trying to explain and convince Rama that he should come back to Ayodhya and rule the kingdom being the eldest son of the current king Dasaratha and not break the long-standing tradition of the Ikshvaku race:
Of Bhagiratha was born kakutstha, from whom the Kakutsthas take their name. To Kakutsthas was born a son called Raghu, from whence spring Raghavas.
From Raghu was born a renowned son named Pravriddha, known in the world under the names Purushadaka, Kalmashapada and Soudasa.
Kalmashapada's son was renowned as Shankhana, who, even on attaining his father's valour, perished (in a battle) along with his army.
The fortunate Sudarshana was the son of Shankhana. Sudarshana's son was Agnivarna; and of Agnivarna was born Shighraga. Shighraga begot Maru and Maru's son was Prashushruva from Prashushruva was born Ambarisha of that great radiance. To Ambarisha was born a son named Nahusha who was full of valour. Nahusha's son was Nabhaga of outstanding virtue. Aja and Suvrata were the two sons of Nabhaga and it was Aja who begot the virtuous King Dasartha.
You are the eldest son of that Dasaratha, very well-known as Rama, the heir who can claim over the inheritance. O, King! Hence, take over your kingdom and look after your people there.
If you are interested in the complete family tree of Sri Rama (ancestors as well as descendants), you can find it on Wikipedia.