Hide certain directories and files in RadFileExplorer
|
Article relates to
|
RadFileExplorer
|
|
Created by
|
Fiko, Telerik
|
|
Last modified
|
January 27, 2009
|
|
Last modified by
|
Fiko, Telerik
|
This article demonstrates how to filter(hide) desired files from the
RadFileExplorer control. For example, this approach can be applied in case that you need to hide system files.
The best and the most simple way to do this is by using a
CustomContentProvider. Bellow are the steps that we need to implement in order to get the provider to filter the items that we need to hide.
- First we need to inherit the base class - Telerik.Web.UI.Widgets.FileSystemContentProvider.
- Then we need to override its ResolveDirectory() method of the base class as follows :
C# :
VB.NET :
In this function we filtered the files.
- Then we need to exclude the directories that are system directories. This can be done in the ResolveRootDirectoryAsTree() function and we need to override it as follows :
C# :
VB.NET :
- In both of the overridden functions we used the IsFiltered() function. This function is a client function and for demonstration purposes we implement it as follows :
C# :
VB.NET :
After implementing all of the above steps, the RadFileExplorer control will filter all of the items(folders and files), that end with ‘.sys’ or contain “_sys” in their name. The full working example can be found attached to the thread.
Comments
If you'd like to comment on this KB
article, please, send us a
Support Ticket.
Thank you!
Please
Sign In
to rate this article.