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

excluding using Configuration

4 Answers 67 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Sunil
Top achievements
Rank 1
Sunil asked on 04 Feb 2013, 08:03 PM
I have my RadFileExplorer working great, but how can I exclude specifics from the list? 

I use RadFileExplorer.Configuration.SearchPatterns to find jpegs and RadFileExplorer.Configuration.ViewPaths to display the correct folder of jpegs (which I then display in RadImageEditor upon a click from the user), but within the correct folder there is an additional folder that I do not want to be shown in the RadFileExplorer. It's a backup folder, and there's no need for the end-user to see it along with the rest of the jpegs, I only want the user to see the jpegs. Is there a way that I can exclude the folder from showing up? Thanks.

4 Answers, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 05 Feb 2013, 11:45 AM
Hi Sunil,

The following demo shows a way to achieve the desired scenario: Filter files and download. I hope examining it thoroughly will allow you to integrate the logic in your code. The demo's description provides extensive information on the case.

Please, feel free to contact us if we could be of any further assistance.

Kind regards,
Vesi
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.
0
Sunil
Top achievements
Rank 1
answered on 05 Feb 2013, 02:44 PM
Is all of this overriding necessary? I just want to exclude one folder from the user's view. 

In other words, to include only jpegs with a certain file name from a specific folder, all I had to do was 2 lines of code.
        FileExplorer1.Configuration.SearchPatterns = new string[] { "*PAGEIMAGE*.jpg"};
        FileExplorer1.Configuration.ViewPaths = new string[] { "~/images" };

So if I want to make just one folder called "backup" invisible from the user, will it really be that involved? I was expecting a quick fix. However, if studying that example is necessary, I will do it.

Just let me know.
Thanks.
  
0
Sunil
Top achievements
Rank 1
answered on 06 Feb 2013, 02:22 PM
I'll submit a support ticket instead. 
0
Vessy
Telerik team
answered on 06 Feb 2013, 03:12 PM
Hi Sunil,

I have just answered your support ticket on the subject, but for convenience I am pasting my answer here as well:

I am afraid to say that the only way to exclude a folder from the FileExplorer ViewPaths is to override the ResolveRootDirectoryAsTree() method by subclassing the existing FileSystemContentProvider.

For your conveninece I have isoated the project from the demo as much as possible, so you could see only the code needed for hiding folders.

private bool IsFiltered(string name)
{
    if (name.ToLower().StartsWith("backup")) //or (name.ToLower().Contains("backup"))
    {
        return true;
    }
 
    // else
    return false;
}

I hope this was helpful for you.

Kind regards,
Vesi
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.
Tags
FileExplorer
Asked by
Sunil
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Sunil
Top achievements
Rank 1
Share this question
or