Sorting a tree view that has a single root?

I have a tree view control that has two modes, one mode is search mode where items are filtered and presented as a flattened list, other mode is a regular tree view.
When items are filtered and therefore it’s a list, the sorting by columns…