We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to refresh Tree or Remove/Change Current Folder Selection


i have work on java script api file explorer in asp.net mvc when i select folder and it containing single file when i have remove file and folder from c# code 
and refresh file explorer using fileExplorerObj.refresh(); method it gives an error message System.IO.DirectoryNotFoundException.

i want refresh the tree and display only available folder in the root directory

as well as change selection of folder from jquery

please revert back asap.


1 Reply

AB Ashokkumar Balasubramanian Syncfusion Team March 17, 2017 04:10 PM UTC

Hi Sagar, 
 
We have analyzed your query (“How to refresh Tree or Remove/Change Current Folder Selection”). We suspect that, the reported issue occurs due to handle the deletion and refresh operions in same Folder Location. So please use the below code snippet to resolve this issue. 
 
[Script] 
 
$.ajax({ 
            url: '@Url.Action("Remove", "FileExplorer")', 
            type: "POST", 
            dataType: "json", 
            data: { Name: value, path: args.path }, 
            success: function (data) { 
                var fileObj = $("#fileexplorer").ejFileExplorer("instance"); 
                fileObj.option("selectedFolder", data); //Pass the parent folder 
                fileObj.refresh(); 
            } 
        }); 
 
For your requirement, we have prepared simple sample, it can be downloaded in below location. 
 
 
Please let us know, if you have any other concerns, 
 
Regards, 
Ashokkumar B. 


Loader.
Up arrow icon