I am having trouble with this too.
The link provided in the answer above opens with the comment "By default, users can sort the row of a DataGrid by clicking the column headers.".
My experience is that this is not true.
For example, if you create the TestDrive tutorial, the datagrid is not sortable by clicking on the column headers.
I've searched and searched on this, lots of articles about more complex sorting but no reference to this apparent lack of simple sorting.
Anyone else found the same?