How common is it that professors have their students write textbooks? I keep hearing my teachers (high school and college) joke about how professors make their grad students write parts of textbooks for them. 

For example, one high school teacher picked up a history textbook and joked that Spielvogel (the author) just made his grad students write all 1000 pages or so. 

How common is this practice? Does this even have a grain of truth?
Amongst the number of professors I have known who wrote textbooks, I have never known this to be the case.  Of course, I have only a small sample...

I have however, known professors to trial run their textbooks on the students in the appropriate class.  I would consider this entirely reasonable and appropriate, as in many cases it would probably be more accurate to say that, in fact, the textbook is a condensation and evolution of the lecture notes of the course that the professor has been developing in any case.