Extending the RadFileExplorer

3 posts, 0 answers
  1. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 11 Apr 2009 Link to this post


    RadControls version


    .NET version


    Visual Studio version


    programming language


    browser support

    all browsers supported by RadControls

    This project encapsulates RadFileExplorer in a user control and extends in with:
    a.) Copy instead of move when you drag a file
    b.) Backup Files when you delete them
    c.) Protect files (disable delete / rename)
    d.) Provide server events for "Folder changed" - "File selected"

    The user control (XFileExplorer) has additional parameter as shown here in the code:
        Supported parameters for XFileExplorer  
        ViewPaths="~/XFiles,~/XImages,~/XDocs"      ###parameter for RadFileExplorer  
        DeletePaths="~/XFiles,~/XImages,~/XDocs"    ###parameter for RadFileExplorer  
        UploadPaths="~/XFiles,~/XImages,~/XDocs"    ###parameter for RadFileExplorer  
        BackupURL="/XBackup"    ###path to the backup directory  
        BackupEnabled="True"    ###enable backup  
        DoCopy="True"           ###copy instead of move  
        ProtectedFiles="/XFiles/Styles/XFEStyles.css,/XFiles/Styles/Main.css,/XFiles/Styles/bkg/PageBKG.jpg" ###protected files / diretories  
        OnFileSelected="xfeOne_OnFileSelected"      ###event when a file is selected  
        OnDirectorySelected="xfeOne_OnDirSelected"  ###event when the current directory has changed  
        <uc1:XFileExplorer ID="xfeOne" runat="server"   
        OnDirectorySelected="xfeOne_OnDirSelected" /> 

    Known issues:
    With the trial version of rad controls you get sometimes an error message (see default.aspx).
    This happens (I guess) because the trial version tries to display a message which does not work very well with ajax calls.
    Sometimes a doubleclick on a folder in the grid (not in the tree) results in an "endless" ajax call.
    Simply choose different folders in the tree (about 2 to 5) and this goes away.
    REASON: when a file or folder is selected I make an ajax call. With a folder RadFileExplorer makes also such a call - and this (if it takes longer to load the directory collides)
    Here is the call which makes the problem:
            function OnClientItemSelected(sender, args) {  
                var item = args.get_item();  
                if (item.get_type() == Telerik.Web.UI.FileExplorerItemType.File) {  
                    TellServerAboutSelectedElement("FILE:" + item.get_path());  
                else {  
                    //if you want the directory selected in grid as "current directory do this  
                    //TellServerAboutSelectedElement("DIR:" + item.get_path()); //signal no file selected!!  
                    //in this case I just want to tell that no file is selected  
    //this call sometimes "freezes" RadFileExplorer when a folder is double clicked  
    The last line in the function makes the problems sometimes.

    How to use the sample:
    Simply open it in visual studio and run it.
    If you run it on a webserver (not the integrated webdev server) ensure that the folders
    /XFiles and /XBackup (including subfolders) have write access for the web server process.

    For closer information about this project take a look at:

    The zip file also includes the three screenshot from the blog (part 4/5).

    Have fun

  2. Georgi Tunev
    Georgi Tunev avatar
    7207 posts

    Posted 15 Apr 2009 Link to this post

    Hi Manfred,

    Thank you for the project - I am sure that it will be helpful for the other members of our community.
    Your points were updated.

    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Amit Singh
    Amit Singh avatar
    3 posts
    Member since:
    Nov 2010

    Posted 30 Nov 2010 Link to this post

    Hi Manfred,

    I would like to thank you from the bottom of my heart. As the admin above rightfully mentions your code would really help a lot of other members as it has helped me too.

    Once again thanks for your help you Good Samaritan :)

    Warm Regards

    Amit Singh
Back to Top