As you are following the example, the data is first exported with RadGridView.Export() method and then the exported stream is imported and printed. So, you cannot directly insert the suggested code.
You can add this code when you are building the RadDocument to be printed manually, element by element, in your code.
In order to be able to better understand what I suggest, you can to go through the articles about using the RadDocument and about the document viewer control - RadRichTextBox. You could as well review this article on how you could create the document elements. Basically you need to create the document to be printed.
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.