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

Force empty directory

2 Answers 26 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Marco
Top achievements
Rank 1
Marco asked on 19 Aug 2010, 03:37 PM
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 Answers, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 24 Aug 2010, 01:05 PM
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
0
Marco
Top achievements
Rank 1
answered on 24 Aug 2010, 01:14 PM
I didn't think of that.
I'll give it a try.
Thanks
Tags
FileExplorer
Asked by
Marco
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Marco
Top achievements
Rank 1
Share this question
or