Add sort functionality to grid