"The learned say that dharma shastras say this"
Yes, at least one [currently] non-extant Śāstras (Smṛti) do say that.
Pāṇḍuranga Vāmana Kāṇe, better known as P.V. Kāṇe in his widely acclaimed work, History of the Dharmaśāstra: Volume IV, discusses this issue in detail, citing various extant & (currently) non-extant sources, which present both views.
which Smriti or Purana say that a son can not perform ancestral Shraddhas/pinda dana while father or grandfather is alive?
Kāṇe cites the Gobhila-Smṛti (गोभिलस्मृति) which indeed says - a son cannot perform a śrāddha while the father (or other ancestors) is alive:
Quoting from Volume 4 (pages 512-513), History of the Dharmaśāstra
The Viṣṇudharmottara (chap. 75) has several rules of & similar
character. Some of the purāṇas such as Skanda (VI 225, 24-25),
Agni (117.58-59) deal with this matter, Gobhilasmṛti (IT. 93 )
has a long passage on this question, one verse of which is quoted
below§. Many of the commentaries and digests hold
divergent views on this subject, viz, the Mit. Yajñvalkya Smṛti, L 254.Kalpataru
(śr. pp 240 ff), S. K. K. pp. 552-556 and Nirpayasindhu (II, pp.
499-503). It is impossible to reconcile all the views.
The
Kalpataru (on śr. p. 240) states that there are alternative courses
for him whose father is alive:
- (1) He should pass over the father that is alive and offer Piṇḍa to those three ancestors to whom his father offers pindas; (Manu.
III.220, Visņu Dh. S 75.1);
- (2) he should simply offer homa into fire as stated in Āśvalāyana-śrautasūtra (quoted above);
(3) he should NOT engage in the rite of piṇḍīpitryajña or pārvapaśrāddha at all (Gobhila-Smṛti II.93).
The Nirnayasindhu says that there are numerous alternatives mentioned by different writers, that they are forbidden in the Kali
age and that one view is that a man whose father is alive cannot
engage in & pārvapaśrāddha and that the real conclusion is that
śrāddha may be offered to those to whom the father (of the performer)
who is living offers piṇḍas. It is clear that one whose father is
living should have nothing to do with pindadāna for deceased
ancestors. Manu (in latter half of II. 220) allowed an alternative
Viz. one should feed one's father at a dinner (and honour him with the
details of worship such as gandha, dhūpa, dipa) and offer piṇḍas to
the deceased grandfather and great-grandfather. When anyone or two out
of the three paternal ancestors are alive and śrăddha is permitted to
a descendant several alternatives become possible by permutation and
combination, which are passed over here from considerations of space
and utility.
§:
गोभिलस्मृति २.९३.
सपितु पितृकृत्येषु अधिकारो न विद्यते ।
न जीवन्तमतिकम्य किंचिद दद्यादिति श्रुतिः(?) ॥
sapitu pitṛkṛtyeṣu adhikāro na vidyate ।
na jīvantamatikamya kiṃcida dadyāditi śrutiḥ(?) ॥
He (whose father is alive) should NOT engage in the rite of piṇḍīpitryajña or pārvapaśrāddha at all.
Gobhila-Smṛti II.93
(?): unreadable text in the scanned file