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

Programmatically sort by filename

6 Answers 73 Views
This is a migrated thread and some comments may be shown as answers.
Blas
Top achievements
Rank 1
Blas asked on 20 Apr 2009, 09:13 AM
Hello,

Is it possible programmatically shows the Fileexplorer sorted by filename?

Thank you

6 Answers, 1 is accepted

Sort by
0
-DJ-
Top achievements
Rank 1
answered on 22 Apr 2009, 11:10 AM
Hi Roberto,

If I'm not mistaken that's the default behavior.

Regards,
-DJ-
0
Fiko
Telerik team
answered on 22 Apr 2009, 11:26 AM
Hello Roberto,

Yes, you can sort the items by using the grid's client side API as follows:

<script type="text/javascript"
    function OnFileExplorerClientLoad(oExplorer, args) 
    { 
        var masterTable = oExplorer.get_grid().get_masterTableView(); 
 
        masterTable.sort("Name"); 
        // masterTable.sort("Size"); 
    } 
</script> 

The OnFileExplorerClientLoad function is attached to the OnClientLoad event of the RadFileExplorer control.

I hope this helps.

Best wishes,
Fiko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Blas
Top achievements
Rank 1
answered on 05 May 2009, 11:55 AM
Hello

Thank you for your response.

I had placed this code:
 function OnClientLoad(sender, args)  {     
         var masterTable = sender.get_grid().get_masterTableView();    
         masterTable.sort("Name DESC");     
                 
         }  

It didn't work, because when the page is loading (the ajax clock is showed) I saw the files order by filename in desceding order, but when the page completed to load the order is by filename in ascending order.

Regards
Blas
0
Fiko
Telerik team
answered on 07 May 2009, 03:11 PM
Hi Roberto,

The provided function works on my side, and for your convenience I have attached my project to this thread. Please note that the sort function works such as in the Window OS - it sorts the files and the directories separately(when you use the View->Arrange Icons by->Name  for example).
In case that you still experience the problem, please rework it in order to replicate your setup, open a new support ticket and send it back. I will check the project and do my best provide a solution. Also please provide information about the exact version of the control that you use.

Best wishes,
Fiko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Robert
Top achievements
Rank 1
answered on 19 Mar 2012, 04:57 PM
I have a similar question about sorting by name and date for items in the RadFileExplorer - but the C# version;

I am loading the View Paths and the Upload Paths from the C#;

Thanks in advance for any insight;
0
Dobromir
Telerik team
answered on 20 Mar 2012, 05:01 PM
Hi Robert,

I already answered your question in the other thread.

Regards,
Dobromir
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Asked by
Blas
Top achievements
Rank 1
Answers by
-DJ-
Top achievements
Rank 1
Fiko
Telerik team
Blas
Top achievements
Rank 1
Robert
Top achievements
Rank 1
Dobromir
Telerik team
Share this question
or