Skip Navigation LinksHome / Community & Support / Code Library / ASP.NET and ASP.NET AJAX > FileExplorer > Extending the RadFileExplorer

Not answered Extending the RadFileExplorer

Feed from this thread
  • Posted on Apr 11, 2009 (permalink)

    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
    Attached files

    Reply

  • Georgi Tunev Georgi Tunev admin's avatar

    Posted on Apr 15, 2009 (permalink)

    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.

    Reply

  • Amit Singh avatar

    Posted on Nov 30, 2010 (permalink)

    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

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Code Library / ASP.NET and ASP.NET AJAX > FileExplorer > Extending the RadFileExplorer