Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Is there a way to force the AddDataDialog to open to a specific path? I created a tool that when clicked on a specific feature will open the Add Data dialog, but I need it to open starting at a specified location. AddDataDialog doesn't have a property analogous to OpenFileDialog.InitialDirectory.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

The GxDialog which the AddDataDialog uses is responsible for storing the last browse location which is opened on next dialog show. However, changing IGxDialog.StartingLocation has only effect if the dialog is actually shown, but you want to show the AddDataDialog instead.

There is one (rather dirty) way, and that's to change registry value named HKEY_CURRENT_USER\Software\ESRI\ArcCatalog\Settings\LastBrowseLocation to the catalog path you want the AddDataDialog navigate when shown. It is a string entry. For filesystem paths, it's quite straighforward provided that the disk drive is connected in ArcCatalog.

share|improve this answer
    
As it turns out GxDialog works better for my situation. Thanks for the help. –  Jeff Berry Jan 27 '11 at 17:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.