I'm using the FileExplorer in a RadWindow called from a main page and would like to have a specific filename selected when the FileExplorer is displayed in the window. I have the javascript setup to pass the file name to and from the window so that's not the real problem. However, I don't seem to be able to find any way to select a file using either sever-side or client-side events. Can anyone help?
I have enclosed the main page and radWindow page code:
default.aspx:
file.aspx:
Many thanks in advance.
Jason
I have enclosed the main page and radWindow page code:
default.aspx:
| <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head runat="server"> |
| <title></title> |
| <script type="text/javascript"> |
| function clientShow(sender, eventArgs) { |
| var txtInput = document.getElementById("TextBox1"); |
| sender.argument = txtInput.value; |
| } |
| function clientClose(sender, args) { |
| if (args.get_argument() != null) { |
| alert("'" + sender.get_name() + "'" + " was closed and returned the following argument: '" + args.get_argument() + "'"); |
| } |
| } |
| </script> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <telerik:RadScriptManager ID="RadScriptManager1" runat="server" > |
| </telerik:RadScriptManager> |
| <div> |
| </div> |
| <asp:TextBox ID="TextBox1" runat="server" Width="250px">default.aspx</asp:TextBox> |
| <asp:Button ID="Button1" runat="server" onclick="Button1_Click" |
| Text="Select File" /> |
| <br /> |
| <telerik:RadWindow ID="RadWindow1" runat="server" NavigateUrl="file.aspx" Width="550px" Height="450px" |
| OnClientClose="clientClose" OnClientShow="clientShow"> |
| </telerik:RadWindow> |
| </form> |
| </body> |
| </html> |
file.aspx:
| <%@ Page Language="C#" AutoEventWireup="true" CodeFile="file.aspx.cs" Inherits="file" %> |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head runat="server"> |
| <title></title> |
| <script type="text/javascript"> |
| function GetRadWindow() { |
| var oWindow = null; |
| if (window.radWindow) |
| oWindow = window.radWindow; |
| else if (window.frameElement.radWindow) |
| oWindow = window.frameElement.radWindow; |
| return oWindow; |
| } |
| function receiveArg() { |
| txtInput = document.getElementById('TextBox1'); |
| var currentWindow = GetRadWindow(); |
| txtInput.value = currentWindow.argument; |
| } |
| function returnArg() { |
| txtInput = document.getElementById('TextBox1'); |
| var oWnd = GetRadWindow(); |
| oWnd.close(txtInput.value); |
| } |
| </script> |
| </head> |
| <body onload="receiveArg();" > |
| <form id="form1" runat="server"> |
| <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> |
| </telerik:RadScriptManager> |
| <div> |
| <telerik:RadFileExplorer ID="RadFileExplorer1" runat="server" Height="300px" |
| Width="450px" > |
| <Configuration SearchPatterns="*.*" ViewPaths="~/"></Configuration> |
| </telerik:RadFileExplorer> |
| <br /> |
| <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> |
| <asp:Button ID="Button1" runat="server" Text="Close" OnClientClick="returnArg()" /> |
| </div> |
| </form> |
| </body> |
| </html> |
Many thanks in advance.
Jason