ArcGIS Pro 3.1 API Reference Guide
ArcGIS.Desktop.Catalog Namespace / SaveItemDialog Class / DefaultExt Property
Example

In This Topic
    DefaultExt Property
    In This Topic
    Gets and sets the default file extension.
    Syntax
    public string DefaultExt {get; set;}
    Public Property DefaultExt As String
    Remarks
    If a file extension is not provided in the Browse dialog box's Name text box, the default file extension specified by this property will be appended to the provided file name. For example, when information is saved to a text file, the default file extension might be "txt".
    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.0 or higher.
    See Also