This is a migrated thread and some comments may be shown as answers.

Sorting Files in ExplorerPopulated Event

0 Answers 100 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 20 Mar 2012, 11:35 PM
The below code snippet is very close to resolving an issue with the sort order of .pdf and .xls documents, contained in a RadFileExplorer;

The following sort order is an example of the issue; 
DD 1-19-12.pdf
DD 1-20-12.pdf
DD 1-3-12.pdf

The last file in the list (DD 1-3-12.pdf) should actually be listed first in this scenario; The date contained in the name of the file is probably causing the sort issue, but modifying the name of the file is not an option;  In the below code snippet, I have replaced Name with Path - but to no avail;

The RadFileExplorer is being loaded in C#, by setting assigning ViewPaths and Upload Paths programmatically;

void RadFileExplorer1_ExplorerPopulated(object sender, RadFileExplorerPopulatedEventArgs e)
       {
           e.List.Sort(delegate(FileBrowserItem fileBrowserItem1, FileBrowserItem fileBrowserItem2)
           {
               return fileBrowserItem1.Name.CompareTo(fileBrowserItem2.Name); 
           });
       }

No answers yet. Maybe you can help?

Tags
FileExplorer
Asked by
Robert
Top achievements
Rank 1
Share this question
or