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

Add node to TreeView

1 Answer 59 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Aaron C
Top achievements
Rank 1
Aaron C asked on 17 Aug 2010, 04:39 PM

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.

1 Answer, 1 is accepted

Sort by
0
Aaron C
Top achievements
Rank 1
answered on 18 Aug 2010, 05:48 PM
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]
        );
}
Tags
FileExplorer
Asked by
Aaron C
Top achievements
Rank 1
Answers by
Aaron C
Top achievements
Rank 1
Share this question
or