Controls Put In a RadDock ContentTemplate Don't Work on WebKit Browsers

3 posts, 0 answers
  1. Daniel Ellis
    Daniel Ellis avatar
    4 posts
    Member since:
    Feb 2010

    Posted 19 Feb 2010 Link to this post

    We are trying to resolve an issue that happens when using the dock on any WebKit based browsers (Google Chrome, Safari for Windows, etc.)  The issue appears to be that when dock.set_handle is called, it causes controls to not work on these browsers.  The example below should run unmodified and show that a dropdownlist works fine as long as the dock handle is not set.  As soon as you call dock.set_handle, the dropdownlist will no longer dropdown at all.  This is a pretty big issue for us.  Any ideas? 

    UPDATE: Added code sample.

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %> 
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> 
    <html xmlns="" > 
    <head runat="server"
        <script type="text/javascript" language="javascript"
            function SetDockHandle(dock) { 
                var d = document.getElementById("Handle_1") 
                //comment the next line out and the dropdownlist will work. 
        <form id="form1" runat="server"
            <asp:ScriptManager ID="scriptmanager1" runat="server" /> 
            <telerik:RadDockLayout runat="server" EnableViewState="false" StoreLayoutInViewState="false" ID="RadDockLayout1"
                <telerik:RadDockZone runat="server" Skin="" ID="RadDockZone1" BorderColor="Transparent" Orientation="Horizontal"
                    <telerik:RadDock runat="server" ID="raddock_1" OnClientInitialize="SetDockHandle"
                            <div id="Handle_1"
                                <asp:DropDownList ID="test" runat="server"
                                    <asp:ListItem Value="0" Text="test 0" /> 
                                    <asp:ListItem Value="1" Text="test 1" /> 

    UPDATE 2: This is still an issue but it can be worked around by adding the control to the dock's ContentContainer instead of using a ContentTemplate.  Using that workaround produces a few new issues.  First, since you're changing the control hierarchy, the client id will change and you'll have to do a second check in the SetHandle javascript to look for the element in webkit browsers.  The other (worse) issue is that all the styling I did in the template no longer works so you now have elements that are drag-and-drop, but unstyled.  I can probably work around this by setting the styles manually somewhere else but the effect of this is styles in two places.  No other ideas, explanations or workarounds from the telerik staff about this?

    UPDATE 3: Here is code similar to what I am using to resolve the above issues.  This causes my docks to work on webkit browsers and the style is not duplicated.  Since the style is in a css normally used by the ITemplate, I just set it manually in javascript.  Again, a hack but it works at least.

    function SetDockHandle(dock) { 
                    //crazy string stuff because is messing with client ids. 

                    var id = dock.get_id(); 
                    var idx = id.indexOf("RadDock"); 
                    var sub = id.substring(idx); 
                    //jquery doesn't work here. something about the jquery draggable plugin the telerik control uses clashing? 
                    //var d = $("#" + dock.get_id() + "_C_Handle_" + sub) 
                    var d = document.getElementById(dock.get_id() + "_C_Handle_" + sub);

                    if(d == undefined) { 
                        //webkit fixes, since we have to add to the content container instead, the naming convention is different. 
                        d = document.getElementById(dock.get_id() + "_C"); 
                        //also set the style class manually since the template that contains the styles can't be used. 

  2. Pero
    Pero avatar
    1156 posts

    Posted 25 Feb 2010 Link to this post

    Hi Daniel,

    I am glad you found a work around to this problem.

    I just wanted to let you know that this is expected behavior. The same will happen if you put a DropDown inside the dock's TitleBarTemplate. To avoid this behavior you need to disable dragging of the dock when the DropDown is clicked. Please take a look at the following online demo: If you carefully examine the source code you will notice that the movement is disabled when the user edits the title.

    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.
  3. DevCraft R3 2016 release webinar banner
  4. Daniel Ellis
    Daniel Ellis avatar
    4 posts
    Member since:
    Feb 2010

    Posted 26 Feb 2010 Link to this post

    Thanks for the update.  That's an easy detail to miss, even after going through the demos.  I added a function (called when the page loads) that will load all of the dropdownlists I'm looking for (using jQuery, loaded by a css class they share) and adds the mousedown handler.  My code that fixes this now looks like this:

    function EnableDockDrag(enable) 
        var ddls = $("select.mDdl"
        if(ddls.length > 0) { 
            for(i = 0; i <= (ddls.length - 1); ++i) { 
                if (enable) { 
                    $addHandler(ddls[i], "mousedown"function(e) { 

Back to Top