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

Customize a folder name in RadFileExplorer

1 Answer 37 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
ABC
Top achievements
Rank 1
ABC asked on 12 Sep 2013, 02:01 PM
I have specific folder names for each users, like, 1, 2, 3, 4, etc. I need to make this My Documents. Is it possible to just change it's directory name?

1 Answer, 1 is accepted

Sort by
0
Accepted
Ianko
Telerik team
answered on 17 Sep 2013, 08:56 AM
Hi,

You could use a custom content provider and modify the ResolveRootDirectoryAsTree() method with the desired functionality to change the folder's name.

Please follow this server-side implementation as an example for the desired customization:
public class CustomContentProvider : FileSystemContentProvider
{
 
    public CustomContentProvider(HttpContext context, string[] searchPatterns, string[] viewPaths, string[] uploadPaths, string[] deletePaths, string selectedUrl, string selectedItemTag)
        : base(context, searchPatterns, viewPaths, uploadPaths, deletePaths, selectedUrl, selectedItemTag)
    {
    }
 
    public override DirectoryItem ResolveRootDirectoryAsTree(string path)
    {
        DirectoryItem orgDir = base.ResolveRootDirectoryAsTree(path);
 
        if (orgDir.Name.ToLower() == "customfolder")
            orgDir.Name = "ModifiedName";
 
        return orgDir;
    }
 
}


Regards,
Ianko
Telerik
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 the blog feed now.
Tags
FileExplorer
Asked by
ABC
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Share this question
or