Sort / group table with external controls

FYI another scenario when you may want to use this is if you need to color odd/even rows, and want the colors stay regardless of sorting: