Extending the RadFileExplorer

Thread is closed for posting
3 posts, 0 answers
  1. 78C3B137-E2EA-4459-8402-7347F45A7CFE
    78C3B137-E2EA-4459-8402-7347F45A7CFE avatar
    885 posts
    Member since:
    Nov 2003

    Posted 11 Apr 2009 Link to this post

    Requirements

    RadControls version

    2009.1.402.35

    .NET version

    3.5

    Visual Studio version

    2008

    programming language

    C#

    browser support

    all browsers supported by RadControls


    PROJECT DESCRIPTION
    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"   
        BackupURL="/XBackup"      
        BackupEnabled="True"   
        DoCopy="True" 
        ProtectedFiles="/XFiles/Styles/XFEStyles.css,/XFiles/Styles/Main.css,/XFiles/Styles/bkg/PageBKG.jpg"   
        ViewPaths="~/XFiles,~/XImages,~/XDocs"   
        DeletePaths="~/XFiles,~/XImages,~/XDocs"   
        UploadPaths="~/XFiles,~/XImages,~/XDocs"   
        OnFileSelected="xfeOne_OnFileSelected"   
        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) {  
                    args.set_cancel(true);  
                    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  
                    TellServerAboutSelectedElement("FILE:");  
     
                }  
            }  
     
    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:
    http://manni-at.spaces.live.com/blog/cns!82CF2A6C0D0C6F3C!133.entry?&_c02_vws=1

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

    Have fun

    Manfred
  2. 000585EE-7DFC-4C10-B6EB-448F2DA3AFB4
    000585EE-7DFC-4C10-B6EB-448F2DA3AFB4 avatar
    7207 posts
    Member since:
    Jul 2016

    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.


    Regards,
    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. 91918BF7-25E1-43D6-8D1A-EEB1802EEC07
    91918BF7-25E1-43D6-8D1A-EEB1802EEC07 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

This Code Library is part of the product documentation and subject to the respective product license agreement.