How to make FolderPicker show files

Mike 1 Reputation point
2020-11-06T18:16:28.933+00:00

Users often get confused when selecting a folder, when they see no files in that folder. The issue was also mentioned in this SO: https://stackoverflow.com/questions/55844072/show-files-in-folder-while-using-folderpicker/55844181

My code is essentially the same:

var folderPicker = new FolderPicker
            {
                SuggestedStartLocation = PickerLocationId.Desktop,
                FileTypeFilter = { "*" } // or ".jpg"
            };

            var folder = await folderPicker.PickSingleFolderAsync();

But I see no files whatsoever.

Windows version 19042.610.

Universal Windows Platform (UWP)
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Yan Gu - MSFT 2,676 Reputation points
    2020-11-09T07:12:31.893+00:00

    Hello,

    Welcome to Microsoft Q&A.

    It is an expected behavior that a FolderPicker dialog shows folders, because a FolderPicker instance represents a UI elemnet that lets user choose folders based on the FolderPicker class.

    There is no such picker in UWP can let you select a folder or a file within single picker. If you want to pick a folder by using a FolderPicker and display files in the dialog of the FolderPicker at the same time, it is also not supported.

    If you want to pick single file or multiple files, you can use FileOpenPicker class.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.