Customize Folder Text

4 posts, 0 answers
  1. Frank
    Frank avatar
    86 posts
    Member since:
    Mar 2012

    Posted 07 Apr 2014 Link to this post

    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.
  2. Frank
    Frank avatar
    86 posts
    Member since:
    Mar 2012

    Posted 07 Apr 2014 in reply to Frank Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Frank
    Frank avatar
    86 posts
    Member since:
    Mar 2012

    Posted 09 Apr 2014 in reply to Frank Link to this post

    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
  5. Frank
    Frank avatar
    86 posts
    Member since:
    Mar 2012

    Posted 09 Apr 2014 in reply to Frank Link to this post

    Was able to get this to finally work and dynamically.
Back to Top