ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Catalog Namespace / SaveItemDialog Class / FilePath Property
Example

In This Topic
    FilePath Property (SaveItemDialog)
    In This Topic
    Gets the name of the file that will be saved.
    Syntax
    public string FilePath {get;}
    Public ReadOnly Property FilePath As String
    Remarks

    The FilePath property is set as a result of browsing in the dialog box to a location and providing a name for the new file that will be created. You can get the property's value after dismissing the Browse dialog box.

    The value returned from the FilePath property is the full path to the file and its file name. The path is determined based on the location currently being viewed in the Browse dialog, which is extracted from the breadcrumb control. The file name includes the file extension that was specified in the Name text box or was defined as the default file extension for the dialog box.

    Example
    Show_SaveItemDialog
    SaveItemDialog saveMapFileDialog = new SaveItemDialog()
    {
      Title = "Save Map File",
      InitialLocation = @"C:\Data\NewYork\Counties\Maps",
      DefaultExt = @"mapx",
      Filter = ItemFilters.Maps_All,
      OverwritePrompt = true
    };
    bool? result = saveMapFileDialog.ShowDialog();
    
    if (result == true)
    {
      ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show("Returned file name: " + saveMapFileDialog.FilePath);
    }
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also