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

Customize Folder Text

3 Answers 40 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Frank
Top achievements
Rank 1
Frank asked on 07 Apr 2014, 06:15 PM
I have tried to use the CustomContentProvider to alter the parent directory name with no success

In one case when have the parent and then files under the parent.
In other cases we have a parent, that I want to customize the text and then sub folder that I want to display as they are in the file structure

When I try to use the CustomContentProvider I see no folders, in either case.
This is the code
​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);


orgDir.Name = folderText;
return orgDir;
}
}


The parent folder is dynamic based on what was selected.

3 Answers, 1 is accepted

Sort by
0
Frank
Top achievements
Rank 1
answered on 07 Apr 2014, 07:05 PM
OK I found the first issue I had the Treeview hidden.

If it is just a top level folder the folder names changes and I get the files so this is working properly.

​The problem now is if I have subfolder under the top folder I don not get the subfolders or the files in the sub folders, but it does change the display name for the top folder.
0
Frank
Top achievements
Rank 1
answered on 09 Apr 2014, 04:38 PM
Still trying to find out how to change the parent folder and still get the child folder to still display.

Example
5873
 --- Folder 1
 --- Folder 2
 --- Folder 3

If I change the parent 5873  to show John Smiths Files I lose all the sub folder.   so I  get

John Smiths Files


I still need it to display Folder1 Folder2 and Folder3
0
Frank
Top achievements
Rank 1
answered on 09 Apr 2014, 08:16 PM
Was able to get this to finally work and dynamically.
Tags
FileExplorer
Asked by
Frank
Top achievements
Rank 1
Answers by
Frank
Top achievements
Rank 1
Share this question
or