This is a migrated thread and some comments may be shown as answers.

Want Users to see Only Folders

3 Answers 88 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
GP
Top achievements
Rank 1
GP asked on 18 Mar 2013, 06:05 PM
Is there a way to just show folders?  We are trying to use the file explorer for users to select the folder they want to save into.  We don't want them picking accidentally .pdf file to save into.

Thanks!

3 Answers, 1 is accepted

Sort by
0
Accepted
Vessy
Telerik team
answered on 19 Mar 2013, 02:05 PM
Hi Genie,

A way to achieve the described scenario is to show only the folders' tree to the users, by configuring the FileExplorer's VisibleControls property in a similar way:
<telerik:RadFileExplorer ID="FileExplorer1" runat="server" EnableCopy="true" VisibleControls="Toolbar,TreeView,ContextMenus,AddressBox">
    <Configuration ViewPaths="~/" DeletePaths="~/" UploadPaths="~/"/>
</telerik:RadFileExplorer>

Nevertheless, if you want to keep visible both the TreeView and the Grid, another possible approach is attach a handler to the ExplorerPopulated Server-side event, where to remove the files from the shown items:
protected void RadFileExplorer1_ExplorerPopulated(object sender, RadFileExplorerPopulatedEventArgs e)
{
    List<FileBrowserItem> items = e.List;
 
    if (e.ControlName == "grid")
    {
        int i = 0;
        while (i < items.Count)
        {
            if (items[i] is FileItem)
            {
                items.Remove(items[i]);
            }
            else
            {
                i++;
            }
        }
    }
}


Regards,
Vesi
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
GP
Top achievements
Rank 1
answered on 26 Mar 2013, 02:27 PM
That worked.  Thank you!
0
Aravind
Top achievements
Rank 2
Iron
Iron
Iron
answered on 07 Feb 2014, 08:56 AM
Hai

    same like is it possible to get system folder structure ? in ur example only show website folder in server,but i need to show folder structure of server machine and can select folder and show path in textbox same as ur example.
Tags
FileExplorer
Asked by
GP
Top achievements
Rank 1
Answers by
Vessy
Telerik team
GP
Top achievements
Rank 1
Aravind
Top achievements
Rank 2
Iron
Iron
Iron
Share this question
or