<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

<%@ 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">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager id="ScriptManager1" runat="server"> </asp:ScriptManager>
        <script type="text/javascript">
            //<![CDATA[                        
            
            /**********************************************************
                                    File Explorer Events
            **********************************************************/ 
            function OnClientDisplay(sender,args)
            {                  
                LogEvent("Grid refresh: " + args.get_path());
            }
            function OnClientGridDblClick(sender,args)
            {
                LogEvent("Grid dblclick: " + args.get_path());
            }
            function OnClientItemClick(sender,args)
            {            
                LogEvent("Item click: " + args.get_path());
            }        
            function OnClientDirectoryChange(sender,args)
            {            
                LogEvent("Tree dir change: " + args.get_path());
            }
            function OnClientDelete(sender,args)
            {
                LogEvent("Delete: " + args.get_path());
                args.set_cancel(true);
            }
            function OnClientCreateNewFolder(sender,args)
            {
                LogEvent("Create new folder in: " + args.get_path());
                args.set_cancel(true);
            }
            
            /**********************************************************
                                    Helper
            **********************************************************/ 
            function LogEvent(text)
            {
                var d = new Date();
                var dateStr = d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds() + "." + d.getMilliseconds();
                var eventConsole = $get("eventConsole");
                eventConsole.innerHTML = "[" + dateStr + "] " + text + "<br/>" + eventConsole.innerHTML;
            }            
            //]]>
        </script>
        <table cellspacing="10">
            <tr>
            <td>
                <telerik:RadFileExplorer runat="server" ID="FileExplorer1" Width="450" Skin="Office2007"
                    OnClientDisplay="OnClientDisplay"
                    OnClientGridDblClick="OnClientGridDblClick"
                    OnClientItemClick="OnClientItemClick"            
                    OnClientDirectoryChange="OnClientDirectoryChange"
                    OnClientDelete="OnClientDelete"
                    OnClientCreateNewFolder="OnClientCreateNewFolder"          
                >
                    <Configuration ViewPaths="~/" />
                </telerik:RadFileExplorer> 
            </td>
            <td>
                <div id="eventConsole" class="module" style="height: 470px;width:300px;overflow:auto;"></div>            
            </td> 
            </tr>
        </table>  

           
    </form>
</body>
</html>
