In my WPF app the user needs to select a folder, which path is in the company network. I use the System.Windows.Forms.FolderBrowserDialog
and the following code gets executed on a button click event:
FolderBrowserDialog fbd = new FolderBrowserDialog();
fbd.SelectedPath = "\\\\company.net\\data\\_Confidential";
DialogResult result = fbd.ShowDialog();
When the FolderBrowserDialog
opens, the system automatically scans for other network devices and that causes the following problem:
The network tree gets filled with other devices and causes my SelectedPath
to scroll away. This is pretty annoying when a user starts searching for a special subfolder, because he has to scroll down or his selection clicks can hit a newly added device (lost focus).
How can i avoid this problem?
Thoughts:
- Can I extend/overwrite the
System.Environment.SpecialFolder
Enum and setfbd.RootFolder = System.Environment.SpecialFolder.MySepcialNetworkPath;
- Should I access the network folder with another dialog/control?
- Should I remove the "Browse..."
Button
in my View and instead scan the whole\\\\company.net\\data\\_Confidential
path and provide a combobox/other selection control(e.g. own subfolder-tree)?