Thank you for writing.
In order to collapse the expandable rows of a certain template, just call the CollapseAll method of the latter. Here is an example how to do that for the MasterTemplate:
I hope that you find this information useful. Let me know if you have further questions.
All the best,
the Telerik team