ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Desktop.Catalog Namespace / ItemDialog Class / Filter Property
Example

In This Topic
    Filter Property (ItemDialog)
    In This Topic
    Gets or sets the filter used to restrict the items listed in the Browse dialog box to the subset that is appropriate for a specific task.
    Syntax
    public string Filter {get; set;}
    Public Property Filter As String
    Remarks

    The items available in the Browse dialog box may be filtered to ensure only items appropriate for a specific task are presented. For example, when the Browse dialog box is used to set a tool's parameter, the parameter may require the item to be set to a point feature class or a raster dataset. Items are filtered by specifying a filter or providing the identifier of a browse dialog filter defined in DAML.

    Example
    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
    };
    
    SaveItemDialog
    SaveItemDialog saveLayerFileDialog = new SaveItemDialog()
    {
      Title = "Save Layer File",
      InitialLocation = @"C:\Data\ProLayers\Geographic\Streets",
      Filter = ItemFilters.Files_All
    };
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also