The dialog uses InitialDirectory = "D:\Executech\Hotel\Documents"
To see the documents in the folder I must specify the parent folder of "Documents". If I use the same path as InitialDirectory, no files are seen.
This is my code that shows the files.
4 Answers, 1 is accepted
You need to include the parent folders as well:
Private Sub SaveFile_DirectoryRequesting(ByVal sender As Object, ByVal e As Telerik.WinControls.FileDialogs.DirectoryRequestingEventArgs) e.Cancel = True If e.Directory.FullName = "C:\" OrElse e.Directory.FullName = "C:\Program Files" OrElse e.Directory.FullName = "C:\Program Files\Docker" OrElse e.Directory.FullName.StartsWith("C:\Program Files\Docker\Docker") Then e.Cancel = False End If End Sub
Let me know how this works for you.
This gets me closer. Thanks.
Using e.Directory.FullName.StartsWith() on that last OrElse gives access to all sub folders in the users "Home" folder.
Since I won't know the path each customer has I need code that will allow any folder to work. This code creates an array from each parent folder but the sub gets called again after it completes. Am I doing something wrong or is there something I can do to break the loop?
I want to suggest a slightly different approach. You can build a list of directories for the before showing the dialog and then use it in the event. Here is the code:
I hope this helps. Should you have any other questions, do not hesitate to ask.