ArcGIS Pro 3.7 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 Property Filter As String
    public string Filter {get; set;}
    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
    {
      // Variables not used in samples
      OpenItemDialog selectItemDialog = new(); // in #region BrowseDialogItems
    
      // Adds a single item to a map
      OpenItemDialog addToMapDialog = new()
      {
        Title = "Add To Map",
        InitialLocation = @"C:\Data\NewYork\Counties\Erie\Streets",
        Filter = ItemFilters.Composite_AddToMap
      };
    }
    SaveItemDialog
    {
      SaveItemDialog saveLayerFileDialog = new()
      {
        Title = "Save Layer File",
        InitialLocation = @"C:\Data\ProLayers\Geographic\Streets",
        Filter = ItemFilters.Files_All
      };
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also