stringgrid

How to do sorting in StringGrid?

I have a StringGrid table like this: How do I make sure that when you click the "sort by group" and "sort by last name" buttons, for example, the data is sorted from A to Z by the corresponding columns?