Expand/Collapse with Double click

5 posts, 0 answers
  1. ajit
    ajit avatar
    46 posts
    Member since:
    Jun 2009

    Posted 29 Jul 2009 Link to this post

    Hi,
             Please could you provide me with a way of expanding the rad dock with a double click. It is an urgent need in my project.

    Thank you

    Regards,
    Ajit
  2. Vyrban
    Vyrban avatar
    31 posts
    Member since:
    Nov 2008

    Posted 31 Jul 2009 Link to this post

    Hi ajit ,

    I got an example that behavior of the dock is near to the normal browser window: double click on the titlebar expand/collapse the dock.
    Hope it can helps you. Here is the code:
    <body> 
    <script type="text/javascript"
        function toggle(titleBarContent) { 
            var dock = titleBarContent.offsetParent.offsetParent.control; 
            if(dock.get_collapsed()) 
                dock.set_collapsed(false) 
            else 
                dock.set_collapsed(true) 
        } 
     
    </script> 
        <form id="form1" runat="server"
        <asp:ScriptManager ID="ScriptManager" runat="server"></asp:ScriptManager> 
        <div> 
            <telerik:RadDock ID="RadDock1" runat="server"
            <TitlebarTemplate> 
            <div ondblclick="toggle(this)"
                Title 
            </div> 
            </TitlebarTemplate> 
            <ContentTemplate> 
            Dock Content 
            </ContentTemplate> 
            </telerik:RadDock> 
        </div> 
        </form> 
    </body> 

  3. ajit
    ajit avatar
    46 posts
    Member since:
    Jun 2009

    Posted 31 Jul 2009 Link to this post

    Hi Vyrban,
                     Thank you for your reply. Actually i am generating the docks dynamically so i am not sure whether supplying a div tag would work in my case. So is there a way i can supply this functionality dynamically.

    Thank you,

    Regards,
    Ajit
  4. Mr. Plinko
    Mr. Plinko avatar
    56 posts
    Member since:
    Jul 2009

    Posted 31 Jul 2009 Link to this post

    I have this functionality and used this Double Click RadDock Collapse thread to help me out.

    to do this in JavaScript. The sample code is

    <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>  
            <telerik:RadDock ID="RadDock1" runat="server" text="Test" onclientinitialize="OnClientInitialize">        
            </telerik:RadDock>     
            <script type="text/javascript">                  
            function OnClientInitialize(sender, args)      
            {      
                $addHandlers(sender._handle, {"dblclick": myHandler}, sender);      
            }      
                  
            function myHandler()      
            {      
                var isCollapsed = !this.get_collapsed();       
                this.set_collapsed(isCollapsed);       
                this.updateClientState();      
            }      
            </script>     
        </form>  
    </body>  
    </html>  


  5. ajit
    ajit avatar
    46 posts
    Member since:
    Jun 2009

    Posted 31 Jul 2009 Link to this post

    Hello Mr. Plinko ,
                                 Thank you very much, it did solve my problem. Appreciate all your help.

    Regards,
    Ajit
Back to Top