This is a migrated thread and some comments may be shown as answers.

Regarding "File Selector Dialog"

5 Answers 120 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Hessner
Top achievements
Rank 2
Hessner asked on 23 Aug 2009, 07:55 AM
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?

5 Answers, 1 is accepted

Sort by
0
Hessner
Top achievements
Rank 2
answered on 23 Aug 2009, 10:16 PM

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>  
 

 

0
Christopher Zimmermann
Top achievements
Rank 1
answered on 19 Mar 2010, 02:02 AM
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
        } 




0
Georgi Tunev
Telerik team
answered on 19 Mar 2010, 07:42 AM
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.
0
Myke
Top achievements
Rank 2
answered on 01 Mar 2012, 12:59 PM
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.
0
Dobromir
Telerik team
answered on 01 Mar 2012, 02:04 PM
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.
Tags
FileExplorer
Asked by
Hessner
Top achievements
Rank 2
Answers by
Hessner
Top achievements
Rank 2
Christopher Zimmermann
Top achievements
Rank 1
Georgi Tunev
Telerik team
Myke
Top achievements
Rank 2
Dobromir
Telerik team
Share this question
or