Newbie trying to call a "select geodataset" dialog

753
2
05-13-2010 01:58 PM
RichardGwozdz
New Contributor
I'm a newbie with ArcGIS development, so sorry if the answer is overly obvious.

I'm building a ArcMap tool in C# to do some geoprocessing.  I cannot figure out how to open an "input geodataset" dialog that returns the path to the geodataset...the kind you use when entering parameters for geoprocessing tools like "Clip", "Union", etc (see screen capture).  I know how to build a OpenFileDialog in C# and I can filter it for shapefiles, but that won't work if I want to select raster data, or coverages, or features from a geodatabase.  The dialog must be an object, but I can't find info on it. Tips?

0 Kudos
2 Replies
KirkKuykendall
Occasional Contributor III
try IGxDialog
0 Kudos
RichardGwozdz
New Contributor
Thanks very much.  That worked.  Here is what I did:

using ESRI.ArcGIS.CatalogUI;
using ESRI.ArcGIS.Catalog;

        private void button1_Click(object sender, EventArgs e)
        {
            IGxDialog openDialog = new GxDialogClass();
            IEnumGxObject pEnumGxObject = new GxObjectArrayClass();
            IGxObjectFilter pGxFilter = new GxFilterGeoDatasetsClass();
            openDialog.ObjectFilter = pGxFilter;
            openDialog.AllowMultiSelect = false;
            openDialog.RememberLocation = false;
            openDialog.Title = "Input Features";

            openDialog.DoModalOpen(0, out pEnumGxObject);
           

           
        }
0 Kudos