If you listen to the DataGrid's headerRelease event, the event has a property columnIndex to let you know which column the user wanted to sort. So you don't need 10 functions, just one with a switch statement, which is reasonable.
private function handleHeaderRelease(event:DataGridEvent):void
var sort:Sort = new Sort();
field = new SortField("fieldA");
field = new SortField("fieldB");
sort.fields = [field];
masterRecords.sort = sort;