Saving datagrid info

I have a datagrid and would like to be able to save it’s content to a text file and reload it…
I’ve used dataProvider and saved it to a text file but all I get in the text file is [object],[object].

Thank you, M95.