Add node to TreeView

2 posts, 0 answers
  1. Aaron C
    Aaron C avatar
    23 posts
    Member since:
    Sep 2009

    Posted 17 Aug 2010 Link to this post

    Hello, I would like to add a node to the TreeView of the FileExplorer, and I was trying to do this in the Page_Load handler: 

    RadFileExplorer1.TreeView.Nodes.Add(new RadTreeNode("Recycle bin"));

    But this causes my "Recycle Bin" node to be the only one in the TreeView.  Is there a better way to do this?  I would prefer that this node would be at or above the root node, so that it could be used as a recycle bin where users could drag files to.
  2. Aaron C
    Aaron C avatar
    23 posts
    Member since:
    Sep 2009

    Posted 18 Aug 2010 Link to this post

    I found a suitable workaround for this, in case it helps anyone else.  By adding to the ViewPaths of the RadFileExplorer configuration, additional root nodes can be added:

    <Configuration 
        ViewPaths="recycle,/" 
        UploadPaths="/"
        DeletePaths="/" 
        />

    and then in the ResolveRootDirectoryAsTree method I added this:

    if (path == "recycle")
    {
        return new DirectoryItem(
            "Recycle Bin"
            string.Empty, 
            "path"
            "tag"
            PathPermissions.Read, 
            null
            new DirectoryItem[0]
            );
    }
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top