Regarding "File Selector Dialog"

6 posts, 0 answers
  1. Hessner
    Hessner avatar
    189 posts
    Member since:
    Mar 2003

    Posted 23 Aug 2009 Link to this post

    The online demo here do not include the file: "Explorer.aspx" used by RadWindow.

    I cannot see any property like "DialogMode=FileSelector" on the control itself.

    Have anyone tried to setup the "File Selector Dialog" example, and made it work?
  2. Hessner
    Hessner avatar
    189 posts
    Member since:
    Mar 2003

    Posted 23 Aug 2009 Link to this post

    Ok, found a solution like this:

    Caller:

    <script type="text/javascript">  
        function OnFileSelected(fileSelected) {  
            var textbox = $get(currentInputID);  
            textbox.value = fileSelected;  
        }  
     
        var currentInputID = null;  
        function OpenFileExplorerDialog(inputID) {  
            var wnd = $find("<%= ExplorerWindow.ClientID %>");  
            wnd.show();  
     
            currentInputID = inputID;  
        }    
    </script> 

    <telerik:RadWindow runat="server" Width="530px" Height="550px" VisibleStatusbar="false" 

     

     

    NavigateUrl="Explorer.aspx" ID="ExplorerWindow" Modal="true" Behaviors="Close,Move">

     

     

    </

     

    telerik:RadWindow>

     

     

     

    <asp:TextBox ID=

    "UrlLink" runat="server" MaxLength="512" Width="400px" TextMode="MultiLine" Rows="4" Text='<%# Bind("Url") %>'></asp:TextBox>  

     
    <input type="button" onclick="OpenFileExplorerDialog('<%#Container.FindControl("UrlLink").ClientID %>'); return false;" value="Søg dokumenter..." /> 

    Explorer.aspx

    <script type="text/javascript">  
    function OnClientFileOpen(sender, args) {  
        var item = args.get_item();  
        if (item && !item.isDirectory()) {  
            args.set_cancel(true);  
            GetRadWindow().BrowserWindow.OnFileSelected(item.get_url());  
            GetRadWindow().Close();     
        }  
    }   
     
    function GetRadWindow() {  
        var oWindow = null;  
        if (window.radWindow) oWindow = window.radWindow;  
        else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;  
        return oWindow;  
    }  
    </script>  
    </head>  
    <body>  
        <form id="form1" runat="server">  
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
        </telerik:RadScriptManager>  
        <div>  
            <telerik:RadFileExplorer ID="RadFileExplorer1" runat="server" Configuration-ViewPaths="~/uploads/d1" OnClientFileOpen="OnClientFileOpen">  
                <Configuration SearchPatterns="*.*"></Configuration>  
            </telerik:RadFileExplorer>  
        </div>  
        </form>  
    </body>  
     

     

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Christopher Zimmermann
    Christopher Zimmermann avatar
    4 posts
    Member since:
    Feb 2010

    Posted 18 Mar 2010 Link to this post

    Hessner, thanks a lot for posting that.
    Telerik people - Im sure it would help people if you updated the demo to include what should be in Example.aspx.

    I have just one update to Hessner's code. If you use it then the function in the calling file should take only one parameter - the string value of the file.

    So it should be:
    //This function is called from the Explorer.aspx page 
            function OnFileSelected(fileSelected) 
            { 
                var textbox = $get("<%= fileName.ClientID %>"); 
                textbox.value = fileSelected
            } 

    Not this (as it is in the example page:
    //This function is called from the Explorer.aspx page 
            function OnFileSelected(wnd, fileSelected) 
            { 
                var textbox = $get("<%= fileName.ClientID %>"); 
                textbox.value = fileSelected
            } 




  5. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 19 Mar 2010 Link to this post

    Hello Christopher,

    The files that are used in that demo (same holds true for every demo on our site) are available in the Example Source Code & Description section. To view the aspx files, just click on the button next to the default aspx page. The codebehind files can be accessed in the same way.


    All the best,
    Georgi Tunev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. Myke
    Myke avatar
    7 posts
    Member since:
    Sep 2010

    Posted 01 Mar 2012 Link to this post

    This is not so obvious in the new demo site. The little down arrow that used to be next to the file name is no longer there so you will only discover it if you mouse over the filename.

    Could we have the little down arrow back please? I wasted a good half an hour trying to get the code for the explorer.aspx file without realising that it was already available on the demo page.

    thanks.
  7. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 01 Mar 2012 Link to this post

    Hi Myke,

    Thank you for bringing this problem to our attention.

    Actually, "the little down arrow" should be there but the image is missing from the page by some reason. I have logged this issue in our database, and we will handle fix it as soon as possible. Please excuse us for the inconvenience.

    As a small token of gratitude I have updated your Telerik points.

    Greetings,
    Dobromir
    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017