Force empty directory

3 posts, 0 answers
  1. Marco
    Marco avatar
    22 posts
    Member since:
    Jan 2009

    Posted 19 Aug 2010 Link to this post

    Hello,

    My explorer root directories are based upon a user managed config file. It can happen that the directory is incorrect/removed whatever. this creates an ugly error;
    How can I show a userfriendly message that the directory does not exist?
    And/or how can I force the explorer to show an empty directory?

    I tried
    return new DirectoryItem("Invalid directory", string.Empty, "/", "tag", PathPermissions.Read, null, null);
    but that shows the root directory.

    Any ideas?
    Thanks
  2. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 24 Aug 2010 Link to this post

    Hello Marco,

    I recommend you to perform a check in the Page Load event and if a directory does not exists then clear the paths set to RadFileExplorer and then set only the ones that really exists. :
    • You can clear the RadFileExplorer's pats by clearing the TreeView's nodes. This will cause the new  paths (set in the next step) to be populated:
      RadFileExplorer1.TreeView.Nodes.Clear();
    • Then set the paths again, avoiding the incorrect ones
    • Show a message to the client using Scriptmanager.RegisterStartupScrip method

    I hope this helps.

    Greetings,
    Fiko
    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Marco
    Marco avatar
    22 posts
    Member since:
    Jan 2009

    Posted 24 Aug 2010 Link to this post

    I didn't think of that.
    I'll give it a try.
    Thanks
Back to Top