How to disable RadDock in client side?

4 posts, 0 answers
  1. sabarishbabu
    sabarishbabu avatar
    136 posts
    Member since:
    Apr 2009

    Posted 11 May 2010 Link to this post

    Hi,
    I would like to disable the RadDock control in client side.  I am using following method to disable the RadDock its working fine in IE,
    But it's not working on Google chrome browser. How to resolve this problem? any idea let me know...

    function disableDock()  
    {  
        var dock = $find("<%= RadDock1.ClientID%>");  
        var outerDiv = dock.get_element();  
        outerDiv.disabled = true;  

    Thanks
    Sabarish
  2. sabarishbabu
    sabarishbabu avatar
    136 posts
    Member since:
    Apr 2009

    Posted 12 May 2010 Link to this post

    Hi,
    Any update on this post?

    Thanks
    Sabarish
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Bob van der Zinch
    Bob van der Zinch avatar
    10 posts
    Member since:
    Feb 2010

    Posted 12 May 2010 Link to this post

    How exactly you want to disable it? To disable dragging you can use

    dock.set_enableDrag(false); 
  5. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 13 May 2010 Link to this post

    Hi Sabarish,

    There is no built-in functionality that will disable the dock on the client-side. However you could make the dock look "disabled", by disabling its movement, and hiding the commands. The following sample project demonstrates how to do this:

    <%@ 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">
    <head id="Head1" runat="server">
        <title></title>
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
     
            <script type="text/javascript">
                var enabled = true;
                function DisableDock()
                {
                    enabled = !enabled;
                    EnableDisableDock(enabled);
     
                }
                function EnableDisableDock(IsEnabled)
                {
                    var dock = $find("RadDock1");
                    if (IsEnabled)
                    {
                        dock.set_enableDrag(true);
                        dock.get_commandsContainer().style.display = "";
                    }
                    else
                    {
                        dock.set_enableDrag(false);
                        dock.get_commandsContainer().style.display = "none";
                    }
                }
            </script>
     
        </telerik:RadCodeBlock>
    </head>
    <body>
        <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            </Scripts>
        </asp:ScriptManager>
        <input type="button" value="DisableDock" onclick="DisableDock(); return false;" />
        <div>
            <telerik:RadDockLayout ID="RadDockLayout1" runat="server">
                <telerik:RadDockZone ID="RadDockZone1" runat="server" MinHeight="300px" Width="300px">
                    <telerik:RadDock ID="RadDock1" runat="server" Title="RadDock-Title" Width="300px">
                        <ContentTemplate>
                            <br />
                            <br />
                            <br />
                            <br />
                            <br />
                            CONTENT
                            <br />
                            <br />
                            <br />
                            <br />
                            <br />
                        </ContentTemplate>
                    </telerik:RadDock>
                </telerik:RadDockZone>
            </telerik:RadDockLayout>
        </div>
        </form>
    </body>
    </html>



    Regards,
    Pero
    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.
Back to Top