This is very easy to implement just below the search ,new,edit and delete button there is sort order to decide where you can select your associated attribute and select sorting order as either ascending or descending.
As Amrish suggestted, you can implement sort order by clicking sort order option present in the datagrid. When you click sort order you will be presented with the folllowing screen and you can add the attribute to apply sort