ArcGIS Pro 3.1 API Reference Guide
ArcGIS.Desktop.Catalog Namespace / OpenItemDialog Class / Items Property
Example

In This Topic
    Items Property (OpenItemDialog)
    In This Topic
    Gets the items selected in the Browse dialog box.
    Syntax
    public IList<Item> Items {get;}
    Public ReadOnly Property Items As IList(Of Item)
    Example
    Show_OpenItemDialog
    OpenItemDialog addToProjectDialog = new OpenItemDialog();
    addToProjectDialog.Title = "Add To Project";
    addToProjectDialog.InitialLocation = @"C:\Data\NewYork\Counties\Maps";
    addToProjectDialog.MultiSelect = true;
    addToProjectDialog.Filter = ItemFilters.Composite_Maps_Import;
    
    bool? ok = addToMapDialog.ShowDialog();
    
    if (ok == true)
    {
      IEnumerable<Item> selectedItems = addToMapDialog.Items;
      foreach (Item selectedItem in selectedItems)
        MapFactory.Instance.CreateMapFromItem(selectedItem);
    }
    
    BrowseDialogItems
    // cref: OpenItemDialog;ArcGIS.Desktop.Catalog.ItemDialog.Filter
    // cref: OpenItemDialog;ArcGIS.Desktop.Catalog.ItemDialog.InitialLocation
    // cref: OpenItemDialog;ArcGIS.Desktop.Catalog.ItemDialog.Title
    // cref: OpenItemDialog;ArcGIS.Desktop.Catalog.OpenItemDialog
    #region OpenItemDialog
    
    /// Adds a single item to a map
    OpenItemDialog addToMapDialog = new OpenItemDialog()
    {
      Title = "Add To Map",
      InitialLocation = @"C:\Data\NewYork\Counties\Erie\Streets",
      Filter = ItemFilters.Composite_AddToMap
    };
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.0 or higher.
    See Also