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 just works and obviously makes a lot of sense:
However, see the situation when it's not filtered and the tree has a single root node:
The sorting in this case does absolutely nothing because as there is a single root node, no matter what your sorting rules are, the result will always be the same.
But having a sortable tree indeed would be nice, so here the general idea would be to sort each and every level individually:
- 1 (sorting group 1)
- 2 (sorting group 2)
- 3 (sorting group 3)
- 2 (sorting group 2)
- 4 (sorting group 1)
- 5 (sorting group 2)
- 6 (sorting group 3)
- 5 (sorting group 2)
In this case of course, one has to collapse to a certain level to see the effective result, i.e. the hierarchy of nodes isn't rewritten because it would be extremely confusing otherwise.
Question:
Does this approach makes any sense? If not then, what do you suggest instead?