File Explorer Folders but not Files

2 posts, 0 answers
  1. Simon
    Simon avatar
    23 posts
    Member since:
    Apr 2009

    Posted 15 Dec 2009 Link to this post

    I have a solution in which I have created a file upload with the file explorer in a Rad Window as per one of your tutorials.  The tutorial works but my solution does not.  Can someone see what I have missed.

    Please see below for my code.

    ASPX
    <%@ Page Language="C#" %> 
     
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     
    <script runat="server"
     
    </script> 
     
    <html xmlns="http://www.w3.org/1999/xhtml"
    <head runat="server"
        <style type="text/css"
            html, body 
            { 
                margin: 0; 
                padding: 0; 
            } 
        </style> 
        <title></title
    </head> 
    <body> 
        <form id="form1" runat="server"
        <div> 
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
            </telerik:RadScriptManager> 
            <telerik:RadFormDecorator DecoratedControls="All" ID="RadFormDecorator1" runat="server" /> 
     
            <script type="text/javascript"
                //A function that will return a reference to the parent radWindow in case the page is loaded in a RadWindow object 
                function getRadWindow() { 
                    var oWindow = null
                    if (window.radWindow) oWindow = window.radWindow; 
                    else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; 
                    return oWindow; 
                } 
                function OnClientGridDblClick(sender, args) { 
                    var item = args.get_item(); 
     
                    //If file (and not a folder) is selected - call the OnFileSelected method on the parent page 
                    if (item.get_type() == Telerik.Web.UI.FileExplorerItemType.File) { 
                        args.set_cancel(true); 
                        //Get a reference to the opener parent page using rad window 
                        var wnd = getRadWindow(); 
                        var openerPage = wnd.BrowserWindow; 
                        //if you need the URL for the item, use get_url() instead of get_path() 
                        openerPage.OnFileSelected(wnd, item.get_path()); 
                        //Close window 
                        wnd.close(); 
                    } 
                } 
            </script> 
     
            <telerik:RadFileExplorer runat="server" ID="FileExplorer1" VisibleControls="All" 
                Width="530" Height="500" EnableViewState="true" OnClientFileOpen="OnClientGridDblClick" DisplayUpFolderItem="True" 
                Language="en-GB"
                <Configuration SearchPatterns="*.*" DeletePaths="~/Uploads" UploadPaths="~/Uploads" 
                    ViewPaths="~/Uploads"></Configuration> 
            </telerik:RadFileExplorer> 
        </div> 
        </form> 
    </body> 
    </html> 
     

  2. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 18 Dec 2009 Link to this post

    Hi Simon,

    The provided code is correct and I am not quite sure what my cause the problem on your side. Could you please provide me more information about the error that you experience? It will be best if you open a new support ticket and send me the project that reproduces the problem. I will check it and do my best to provide a solution as soon as possible.

    Best wishes,
    Fiko
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top