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.

I am trying to open a ArcGIS file browser. And For this, I used IGxDialog interface's DoModalOpen method. To specify what the user can select using a GxDialog browser is based on the filters (GxObjectFilter) held by the object. To browse workspace, I set ObjectFilter to GxFilterWorkspaces. But it allows folders that contains layers/feature classes/raster datasets that is not IGxDatabase or IWorkspace.

        IGxObjectFilter gxObjectFilter = new GxFilterWorkspaces();
        IGxDialog gxDialog = new GxDialog();
        gxDialog.AllowMultiSelect = false;
        gxDialog.Title = title;
        gxDialog.ObjectFilter = gxObjectFilter;
        gxDialog.ButtonCaption = "Open";
        gxDialog.RememberLocation = true;

        IEnumGxObject enumGxObject;
        gxDialog.DoModalOpen(0, out enumGxObject);
        while ((gxObject = enumGxObject.Next()) != null)
        {
            if ((gxObject as IGxDatabase2) != null)
            {
                return gxObject.FullName;
            }
        }

Question:

What should I do to select only workspace through this browser? Or is there any other option to browse GIS dataset?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

A folder is also a workspace (e.g. for shapefiles).

I do not think there is a built-in filter for selecting geodatabases (if that's what you mean). You can pretty easily implement IGxObjectFilter yourself, though.

share|improve this answer
add comment

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.