1 Attachment(s)
[RESOLVED] [2005] FolderBrowserDialog Sorting????
I have always assumed the FolderBrowserDialog displayed the directories in alphabetical order. But by the looks of it, this is incorrect. Is there a way to get it to display the directories alphabetically? Or do I not know how to alphabetize? I have posted a picture so you don't think I'm wacked out on something.
Re: [2005] FolderBrowserDialog Sorting????
Stumped me for a few minutes, but I see what's going on here...
When it is sorting, its stripping the leading 0 off and going to the next digit. So if you take those 0's off, its in the correct order, notice how the 2 top ones that are out of order would be in correct order if the 0 was not present, same with the one that starts with 02
Re: [2005] FolderBrowserDialog Sorting????
I see what you mean now. But that still doesn't make sense. If that is how it's supposed to function then the first 4 are out of function. :eek2:
Re: [2005] FolderBrowserDialog Sorting????
if there is no number after the 0, it considers it 0.. if there is a number after the 0, it is truncating it off....
I'm not saying its correct, looks like a bad sorting routine either within the framework, or in the underlying win32 control itself, but it is what it is...
Re: [2005] FolderBrowserDialog Sorting????
I think that you'll find that that is a Windows XP feature. Everyone b*tches that Folder1, Folder2 and Folder10 are sorted "alphabetically" instead of how a human would sort them, so Microsoft added functionality to XP to sort files and folders in a more "human" way. What is happening in your case is XP is reading the leading digits as a number and sorting them numerically, then those that start with the same number are sorted alphabetically after that. The first four start with "0" so the number is stripped of altogether and they are sorted alphabetically by the letters that come after the zero. The next eight all start with the number one ("01" is considered to be the number 1) so they are all sorted alphabetically on whatever comes after the "1". After that comes the those that start with the number 2, where "02" is considered the number 2. By default XP will treat leading and trailing digits in a file or folder name as numbers. It would be too hard work to treat other digits as numbers though. You can turn this functionality off in XP but it has nothing whatsoever to do with .NET.
Re: [RESOLVED] [2005] FolderBrowserDialog Sorting????