Programmatically sort by filename

7 posts, 0 answers
  1. Blas
    Blas avatar
    55 posts
    Member since:
    Dec 2007

    Posted 20 Apr 2009 Link to this post

    Hello,

    Is it possible programmatically shows the Fileexplorer sorted by filename?

    Thank you

  2. -DJ-
    -DJ- avatar
    263 posts
    Member since:
    Oct 2004

    Posted 22 Apr 2009 Link to this post

    Hi Roberto,

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

    Regards,
    -DJ-
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 22 Apr 2009 Link to this post

    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.
  5. Blas
    Blas avatar
    55 posts
    Member since:
    Dec 2007

    Posted 05 May 2009 Link to this post

    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
  6. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 07 May 2009 Link to this post

    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.
  7. Robert
    Robert  avatar
    68 posts
    Member since:
    Feb 2009

    Posted 19 Mar 2012 Link to this post

    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;
  8. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 20 Mar 2012 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017