Resize Dock whilst Docked....

3 posts, 0 answers
  1. Richard
    Richard avatar
    38 posts
    Member since:
    Nov 2008

    Posted 09 Sep 2009 Link to this post

    Hi,

    Has anyone got a solution for resizing a dock, whilst it is docked?  I am thinking of creating a custom command to open a dialog / slider to allow for the resize....  But, I was wondering if anyone had worked out a nicer method for doing this?


    Thanks,

    Richard
  2. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 14 Sep 2009 Link to this post

    Hello Richard,

    This functionality is not supported by the RadDock control and it is so by design. However, for your convenience we have created a workaround that overrides the built-in behavior and makes the dock resizable when docked to a zone. Here is the source code of a project that implements this workaround:

    <%@ 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 id="Head1" runat="server"
        <title></title
    </head> 
    <body> 
        <form id="form1" runat="server"
        <asp:ScriptManager ID="ScriptManager1" runat="server"
        </asp:ScriptManager> 
        <div> 
            <telerik:RadDockLayout ID="RadDockLayout1" runat="server"
                <telerik:RadDockZone ID="RadDockZone1" runat="server" Height="300px" Width="500px" 
                    FitDocks="false"
                    <telerik:RadDock ID="RadDock1" runat="server" Width="300px" Title="RadDock-Title" 
                        OnClientResizeEnd="ResizeEnd" OnClientInitialize="DockInit" OnClientDockPositionChanged="DockPositionChanged" 
                        Resizable="true"
                        <ContentTemplate> 
                            <br /> 
                            <br /> 
                            <br /> 
                            <br /> 
                            <br /> 
                            CONTENT 
                            <br /> 
                            <br /> 
                            <br /> 
                            <br /> 
                            <br /> 
                        </ContentTemplate> 
                    </telerik:RadDock> 
                </telerik:RadDockZone> 
            </telerik:RadDockLayout> 
        </div> 
        </form> 
     
        <script type="text/javascript"
            //Workaround to make dock resizable whilst docked 
            var curZone; 
            Telerik.Web.UI.RadDock.prototype.oldResizeStart = Telerik.Web.UI.RadDock.prototype.onResizeStart; 
            Telerik.Web.UI.RadDock.prototype.onResizeStart = function() 
            { 
                curZone = this._dockZoneID; 
                this._dockZoneID = null
     
                this.oldResizeStart(); 
            } 
            function ResizeEnd(dock, args) 
            { 
                this._dockZoneID = curZone
                curZone = null
            } 
            function DockInit(dock, args) 
            { 
                dock._configureHandles(true); 
            } 
            function DockPositionChanged(dock, args) 
            { 
                dock._configureHandles(true); 
            } 
            //Workaround to make dock resizable whilst docked 
             
        </script> 
     
    </body> 
    </html> 
     
         
    I hope this will help you implement your scenario.

    All the best,
    Pero
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Richard
    Richard avatar
    38 posts
    Member since:
    Nov 2008

    Posted 14 Sep 2009 Link to this post

    thanks for the help.  Really appreciated.


    Richard
Back to Top