In the RadFileExplorer I am trying to figure out how to hide the subfolders.
currently I have this which is filter and only showing the file types I want to show.
I have tried to send an empty Array into the Directories but it is still shwing all the sub folders.
public class ExtendedFileProvider : FileSystemContentProvider
{
//constructor must be present when overriding a base content provider class
//you can leave it empty
public ExtendedFileProvider(HttpContext context, string[] searchPatterns, string[] viewPaths, string[] uploadPaths, string[] deletePaths, string selectedUrl, string selectedItemTag)
: base(context, searchPatterns, viewPaths, uploadPaths, deletePaths, selectedUrl, selectedItemTag)
{
}
public override DirectoryItem ResolveDirectory(string path)
{
//get the directory information
DirectoryItem baseDirectory = base.ResolveDirectory(path);
//remove files that we do not want to see
List<
FileItem
> files = new List<
FileItem
>();
foreach (FileItem file in baseDirectory.Files)
{
if (file.Name.Contains(".pdf") || file.Name.Contains(".doc") || file.Name.Contains(".docx") || file.Name.Contains(".zip"))
{
files.Add(file);
}
}
List<
DirectoryItem
> dirs = new List<
DirectoryItem
>();
dirs.Clear();
DirectoryItem newDirectory = new DirectoryItem(baseDirectory.Name, baseDirectory.Location, baseDirectory.FullPath, baseDirectory.Tag, baseDirectory.Permissions, files.ToArray(),dirs.ToArray());
//return the updated directory information
return newDirectory;
}
}