Skip to content

Order of FileTypeChoices in new pickers is not respected #5827

@Marv51

Description

@Marv51

Describe the bug

In Windows.Storage.Pickers.FileSavePicker under FileTypeChoices it says:

If you add multiple FileTypeChoices to the FileSavePicker, the first one added is the default file type. This default will be selected when the user opens the file picker.

https://learn.microsoft.com/en-us/uwp/api/windows.storage.pickers.filesavepicker.filetypechoices?view=winrt-26100

In the new Microsoft.Windows.Storage.Pickers.FileSavePicker there seems to be no way to influence the order of FileTypeChoices as the input order is not the displayed order. The order seems to be always alphabetically, with the alphabetically-first being selected by default.

I thought setting DefaultFileExtension would set the default FileTypeChoice. But it does not. It only seems to work when no FileTypeChoices are added.

Steps to reproduce the bug

// using Microsoft.Windows.Storage.Pickers;

var savePicker = new FileSavePicker(this.AppWindow.Id)
{
    SuggestedStartLocation = PickerLocationId.DocumentsLibrary,
    SuggestedFileName = "MyFile"
};

savePicker.DefaultFileExtension = ".ods";

savePicker.FileTypeChoices.Add("PDF", [".pdf"]);
savePicker.FileTypeChoices.Add("ABC", [".txt"]);
savePicker.FileTypeChoices.Add("Tabellenformat", [".ods"]);

await savePicker.PickSaveFileAsync();

Expected behavior

Same behavior as WinRT API where the order is respected and the first is the default. Or a way to set a default FileTypeChoice manually (see also IFileDialog::SetFileTypeIndex)

Screenshots

No response

NuGet package version

Windows App SDK 1.8.0: 1.8.250907003

Packaging type

Packaged (MSIX)

Windows version

Windows 11 version 24H2 (26100, June 2025 Update)

IDE

Visual Studio 2022

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions