Once the OnSortByDepartment event triggers, it gets the default view of the data grid and adds SortDescription to the SortDescriptions property of the default view instance. SortDescription takes the property name as the first argument. It defines the column for which you want to add the sort functionality. The second parameter is the ListSortDirection, which can be either Ascending or Descending.
It's not limited to a single SortDescriptor. You can add more based on your requirement. At any point of time, when you want to reset the view from the applied sort description, you can call the SortDescriptions.Clear() method on the view (in our case, it is cvs).