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

DefaultExt Property
Gets and sets the default file extension.
Syntax
public string DefaultExt {get; set;}
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 or higher.
See Also