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

EnableCreateNewFolder to no avail.

1 Answer 54 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Sebastian
Top achievements
Rank 2
Sebastian asked on 03 Feb 2010, 02:18 PM
Hi,

I want to enable creation of new folders in the RadFileExplorer. For this I set the property accordingly on control creation:

        private RadFileExplorer CreateAndInitializeExplorer() 
        { 
            RadFileExplorer explorer = new RadFileExplorer() 
            { 
                EnableViewState = true
                VisibleControls = FileExplorerControls.All ^ FileExplorerControls.AddressBox, // only disable AddressBox. show everything else 
                Width = 900.Pixel(), 
                EnableCreateNewFolder = true
                EnableCopy = false 
            }; 
 
            explorer.Load += Explorer_OnLoad; 
            explorer.PreRender += Explorer_PreRender; 
 
            explorer.Configuration.ContentProviderTypeName = typeof(MyContentProvider).AssemblyQualifiedName; 
 
            string[] basePath = MyContentProvider.GetRootsPaths(); 
            explorer.Configuration.ViewPaths = basePath; 
            explorer.Configuration.UploadPaths = basePath; 
            explorer.Configuration.DeletePaths = basePath; 
 
            return explorer; 
        } 

Still, the toolbar and context menu items to create a new Folder are not displayed. All DirectoryItems (that is really every single Item) that are provided from MyContentProvider have the following permissions set:
private const PathPermissions FULL_PERMISSIONS = PathPermissions.Read | PathPermissions.Delete | PathPermissions.Upload; 

So there should be no problem with the permissions of the item.

Please help me to get this sorted out. I need the Create New Folder functionality available for my users.

Regards,

   Sebastian

1 Answer, 1 is accepted

Sort by
0
Sebastian
Top achievements
Rank 2
answered on 03 Feb 2010, 02:44 PM
Whoops. Sorry.
A simple
public override bool CanCreateDirectory { get { return true; } } 
On my custom provider fixed it.

Sorry again,

   Sebastian
Tags
FileExplorer
Asked by
Sebastian
Top achievements
Rank 2
Answers by
Sebastian
Top achievements
Rank 2
Share this question
or