I need to provide my clients with the possibility to select a GDB from within a DockPaneView.
Now that I found out on how to get the parentWindow to satisfy the SelectFolder method I have to realize I cannot set the initialPath attribute. The method expects a string but writing "c:\\" still opens the dialog in the users home directory.
I found that I should be able to set the path to a sub-directory of the users home directory by writing e.g. "~/Documents".
Nothing off this works. I always start in the users home directory. But what I want is the possibility for the user to store the selected path in my solution as a resource variable and next time the SelectFolder dialog is opened the resource variable should retrieve the initial path from the resource file.
Has somebody a working example on how to set the initialPath attribute?
As said, the functionality is required to work from within a DockPaneView (WPF).
Best Thomas
Solved! Go to Solution.
Hi Thomas,
Have you tried like this:
OpenItemDialog searchGdbDialog = new OpenItemDialog
{
Title = "Find GDB",
InitialLocation = Directory.GetCurrentDirectory(),
MultiSelect = false,
Filter = ItemFilters.featureDatasets_all
};
var ok = searchGdbDialog.ShowDialog();
For me it works, I always get last visited folder.
Hi Thomas,
Have you tried like this:
OpenItemDialog searchGdbDialog = new OpenItemDialog
{
Title = "Find GDB",
InitialLocation = Directory.GetCurrentDirectory(),
MultiSelect = false,
Filter = ItemFilters.featureDatasets_all
};
var ok = searchGdbDialog.ShowDialog();
For me it works, I always get last visited folder.
Hi Gintautas,
I really like your solution to the problem. Using OpenItemDialog works in setting the directory and I am pretty sure I can also use it in combination with the resources. A bit of a disadvantage compared to the systems dialog is the indexing of the catalog when the dialog is opened.
Thanks for pointing me this way.