I wrote a comparator and I want to implement it on parent nodes of a TreeView but what I need to be compared is the Node.Tag.ToString() and not by theire Text. As far as I looked there is no overload or another function to do this using TreeView.Sort().
I wonder if you have a way or workaround in mind?
If you have an IComparer, it looks like you can set the TreeViewNodeSorter property to it and then call Sort to have the nodes sorted as you wish.
Example based on that link – not tried, no null checks etc. but it should work:
Then
treeView1.TreeViewNodeSorter = new NodeSorter();somewhere in your setup.