Follow this tutorial..
Databind a GridView and export to Excel or text file[
^]
Check the code of
Export to text file. And change this line...
string Destinationpath = Startuppath + ""+ DateTime.Now.ToString("dd-MMM-yyy") +".txt";
To,
string Destinationpath = Startuppath + ""+ DateTime.Now.ToString("dd-MMM-yyy") +".rtf";
Hope your work should be done.