Show StorageFolders first then StorageFliles RRS feed

  • General discussion

  • Hello,

    I have  app Which Binds a Folder in D drive using Following code I need to show first all storage folders in grdview and then all other files how can  achieve this?

     var queryOptions = new QueryOptions();
                queryOptions.FolderDepth = FolderDepth.Shallow;
                queryOptions.IndexerOption = IndexerOption.UseIndexerWhenAvailable;
                           var itemQuery = PickedFolder.CreateItemQueryWithOptions(queryOptions);
                const uint size = 190; // default size for PicturesView mode
                var fileInformationFactory = new FileInformationFactory(itemQuery, ThumbnailMode.PicturesView, size, ThumbnailOptions.UseCurrentScale, true);
                itemsViewSource.Source = fileInformationFactory.GetVirtualizedItemsVector();
    //Binded to grid view via CollectionViewSource.
    but by this code it shows mixed storagefiles and folders but need to show first folders then files Please Hlp me

    Santana George

    Thursday, April 4, 2013 7:28 AM

All replies

  • I don't know if this will help you, but give it a chance.

    To get all folders from specific location use:
       List<StorageFolder> file = await ApplicationData.Current.LocalFolder.GetFoldersAsync();

    To get all Files from specific location use:
       List<StorageFile> file = await ApplicationData.Current.LocalFolder.GetFilesAsync();

    Hopefully this will help you.


    Thursday, April 4, 2013 3:08 PM
  • Got It

    Instead of prform Storage Item Process StorageFolder then StorageFile

    Santana George

    Friday, April 5, 2013 4:58 AM