You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Order of FileTypeChoices in new pickers is not respected #5827
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.
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;varsavePicker=newFileSavePicker(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"]);awaitsavePicker.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)
I dont think this ever worked (either that or my code was broken).
In DLSS Swapper I use Win32 generated stuff and it didn't seem to work. I just tested trying to set it to csv and .csv but when I open it it is always .json which is the first in my list. This is the same for my open and save dialog code.
I'm having the same problem. In my app the user can export a file to various different file formats and I want to pre-select the file format that the user used in previous export operations. This worked using the old Windows.Storage.Pickers.FileSavePicker, but not with the new one
Activity
beeradmoore commentedon Sep 13, 2025
I dont think this ever worked (either that or my code was broken).
In DLSS Swapper I use Win32 generated stuff and it didn't seem to work. I just tested trying to set it to
csvand.csvbut when I open it it is always.jsonwhich is the first in my list. This is the same for my open and save dialog code.tipa commentedon Sep 19, 2025
I'm having the same problem. In my app the user can export a file to various different file formats and I want to pre-select the file format that the user used in previous export operations. This worked using the old
Windows.Storage.Pickers.FileSavePicker, but not with the new oneFix FileTypeChoices in Storage Pickers to preserve insertion order (#…
Cherry-pick Fix FileTypeChoices in Storage Pickers to preserve insert…
[CP to 1.8] Cherry-pick Fix FileTypeChoices in Storage Pickers to pre…
DinahK-2SO commentedon Dec 4, 2025
Hi Marvin Rühe (@Marv51), thank you for taking the time to report this issue, and sharing the repro details.
The fix is merged and will be available from versions 2.0-exp4 and 1.8.4.
Thanks Marvin Rühe (@Marv51), Brad (@beeradmoore) , Timo Partl (@tipa) , Mahdi Hosseini (@ghost1372) again. Your input helps us improve and deliver a better experience to the community.
Marv51 commentedon Dec 4, 2025
Hi Dinah Xiaoman G (@DinahK-2SO),
Thank you for the quick fix and the good communication.
Snap 2.0-exp4 from main to release/2.0-stable (#6096)
RI 2.0-stable into 2.0-experimental for experimental7 (#6366)