ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Desktop.Core Namespace / Project Class / GetProjectItemContainer Method
The key for the given container
Example

In This Topic
    GetProjectItemContainer Method
    In This Topic
    Get the container with the given key. Container keys are not localized. A container is needed only in those situations where you want to select a specific item that occurs in more than one container.
    Syntax
    public Item GetProjectItemContainer( 
       string key
    )
    Public Function GetProjectItemContainer( _
       ByVal key As String _
    ) As Item

    Parameters

    key
    The key for the given container

    Return Value

    The container Item or null
    Remarks
    Containers can vary from project to project depending on the content. Some containers, therefore, can be null. You can use the following keys to retrieve a container. Check for null.

    Public containers (not including any 3rd party custom containers):

    Display Name(English) Path or "Key" (Non-localizable) Item content
    Databases GDB Database content
    Folders FolderConnection Files and Folders
    Layouts Layout Layouts
    Locators LocatorsConnection Locators
    Maps Map Maps
    Raster Function Templates RasterFunctionTemplates Raster function templates
    Reviewer Batch Jobs DataReviewerBatchJobs Reviewer batch jobs
    Reviewer Results DataReviewerResources Reviewer results
    Servers ServerConnection Server connections
    Styles Style Styles
    Tasks Task Tasks
    Toolboxes GP Toolboxes
    Workflows WorkflowConnection Workflows
    Example
    Select project containers - for use with SelectItemAsync
    //Use Project.Current.ProjectItemContainers
    var folderContainer = Project.Current.ProjectItemContainers.First(c => c.Path == "FolderConnection");
    var gdbContainer = Project.Current.ProjectItemContainers.First(c => c.Path == "GDB");
    var mapContainer = Project.Current.ProjectItemContainers.First(c => c.Path == "Map");
    var layoutContainer = Project.Current.ProjectItemContainers.First(c => c.Path == "Layout");
    var toolboxContainer = Project.Current.ProjectItemContainers.First(c => c.Path == "GP");
    //etc.
    
    //or...use Project.Current.GetProjectItemContainer
    
    folderContainer = Project.Current.GetProjectItemContainer("FolderConnection");
    gdbContainer = Project.Current.GetProjectItemContainer("GDB");
    mapContainer = Project.Current.GetProjectItemContainer("Map");
    layoutContainer = Project.Current.GetProjectItemContainer("Layout");
    toolboxContainer = Project.Current.GetProjectItemContainer("GP");
    //etc.
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also