PDA

View Full Version : Sort TreeNode based on text



forumuser1080
21 Feb 2011, 4:57 PM
I have a TreeNode that when populated resembles a directory structure. I would like to sort the TreeNode such that folders are first and in alp[alphabetic order, and files are next in alphabetic order.

I now that I can call a sort method on the TreeNode and pass it a function that takes two nodes. But I am unsure how to compare the two strings to get the proper -1, 0, 1 return value.

Anyone sorted a TreeNode before? Thanks!