Delete and Upload buttons appear disabled

3 posts, 0 answers
  1. Burbank
    Burbank avatar
    3 posts
    Member since:
    Nov 2009

    Posted 27 May 2010 Link to this post


    I am trying to figure out why the upload and delete buttons appear disabled(greyed out) on my FileExplorer. I am using a custom file content provider.I have set up the upload and delete paths in the code behind. I have also enabled the viewstate. Can someone please advise as to what else needs to be set for the buttons to be enabled.

  2. Christian
    Christian avatar
    9 posts
    Member since:
    Jun 2010

    Posted 01 Jun 2010 Link to this post

    Hi Burbank!

    I just had the same problem. Now it works like a charm!

    I'm also use the content provider to filter some filetypes out like .skin-files.
    My problem with upload/delete was that my delete- and uploadpaths was wrong. Can you share some code?

    Here's some of mine:

    string[] applicationName = new string[] { this.ResolveUrl("~/App_Themes/Standard/") }; 
    string[] allowedUploadPaths = new string[] { "~/App_Themes/Standard/css/", "~/App_Themes/Standard/images/" }; 
    string[] allowedDeletePaths = GetAllowedDeletePaths(); 
    rfeFileExplorer.Configuration.ViewPaths = applicationName
    rfeFileExplorer.Configuration.DeletePaths = allowedDeletePaths
    rfeFileExplorer.Configuration.UploadPaths = allowedUploadPaths

    This way I see all content of App_Themes/Standard (applicationName) in my FileExplorer.
    Create folder and upload are enabled in App_Themes/css and /images (allowedUploadPaths).
    Finally the GetAllowedDeletePaths method returns an array of all contents (just folders) in /css and /images (i.e "~App_Themes/Standard/css/layout", "~App_Themes/Standard/images/buttons"). This is because I dont want the delete-button to be enabled so that I can delete whole css or images folder, just it's content folders.

    I hope this was to some help!


    Christian Persson

  3. Fiko
    Fiko avatar
    1406 posts

    Posted 01 Jun 2010 Link to this post

    Hello Burbank,

    You can set different permission to a folder by passing the desired permission to the constructor of the DirectoryItem. For instance, you can give a folder Delete permission by using this constructor:
    Copy Code
    Copy Code
    DirectoryItem directoryWithReadAndDeletePermissions =
    new DirectoryItem(foldername, foldername, fullpath, string.Empty, PathPermissions.Read | PathPermissions.Delete, new FileItem[0], new DirectoryItem[0]);

    In addition, I recommend you to override the CheckWritePermissions and CheckDeletePermissions (if exist) methods as well.

    Kind regards,
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top