Windows Phone Folder Picker - Show files

615 Views Asked by At

I have following code:

//open folder picker ui
FolderPicker openPicker = new FolderPicker();
openPicker.ViewMode = PickerViewMode.List;
openPicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
//openPicker.FileTypeFilter.Add(".db");
openPicker.CommitButtonText = "Choose location";
openPicker.ContinuationData["Operation"] = "OpenFolder";
openPicker.PickFolderAndContinue();

This code works, but files arend't displayed; in all folders say: "This folder is empty", which is very missleading.
Even with uncommenting the line openPicker.FileTypeFilter.Add(".db"); nothing is displayed although there are somje .db files. Is there any possibility to show files in a folder picker?

1

There are 1 best solutions below

4
On BEST ANSWER

Of course this code will give you "This folder is empty", you looking for ".db" files not folders :

Try this ( Change "FolderPicker" to "FileOpenPicker" ) :

FileOpenPicker openPicker = new FileOpenPicker();
openPicker.ViewMode = PickerViewMode.List;
openPicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
openPicker.FileTypeFilter.Add(".db");
openPicker.CommitButtonText = "Choose location";
openPicker.ContinuationData["Operation"] = "OpenFolder";
openPicker.PickMultipleFilesAndContinue();

EDIT : In case of using "FolderPicker" to slect files, "This folder is empty" mean there is no "folders" ( not files ) in this folder .