Floating on a defined Zone?

2 posts, 0 answers
  1. Shane
    Shane avatar
    18 posts
    Member since:
    Jan 2011

    Posted 22 Apr 2012 Link to this post

    I'm not sure this can be done but figured I would post the question. 

    For our application, we have a multi-dashboard solution with each dashboard having a set of floating docks (due to various sizes, etc).  This works well for most cases but recently we have had customers creating dashboards for 1920 x 1080 monitors. This would be fine if all user machines were 1920x1080 but with the use of tablets, laptops and various PCs this cannot be done.  So what I would like to do is create a display palette (zone) of 1920x1080 that would allow you to place floating docks on it.  Then on a small monitor, it would provide you scrollbars on the zone but on the full size 1920x1080 monitor it wouldn't.  Obviously this would work if we had docked controls but unfortunetly there are way to many control sizing factors preventing this. 

    Has anyone done something like this or have suggestions on how this can be achieved.  Minimally I would be happy if a user with a low resolution monitor would at least get scrolls for a larger designed dashboard. 

    I looked at the restricted zone example.  Here is an example and you notice the scroll doesn't work on the middle splitter section in association to the docks:
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
    <%@ 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">
    <head id="Head1" runat="server">
        <style type="text/css">
        html, body, form
        {   height:100%; margin:0px; padding:0px; overflow:hidden;  }
        <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <telerik:RadSplitter ID="RadSplitter1" runat="server" Height="100%" Width="100%" Orientation="Horizontal">
            <telerik:RadPane ID="RadPane1" runat="server" Height="50" BackColor="Red">
                Top Pane
            <telerik:RadPane ID="RadPane2" runat="server" BackColor="Red">
                <div id="restrictionZone" style="border: solid 1px black; background-color:Green; width: 600px; height: 1200px;">
                Docks are only allowed here<br />
                    <telerik:RadDockLayout ID="RadDockLayout1" runat="server">
                        <telerik:RadDock ID="RadDock1" runat="server" Width="300px" OnClientDragEnd="OnClientDragEnd" Resizable="true" Top="55" Height="200">
            <telerik:RadPane ID="RadPane3" runat="server" Height="50" BackColor="Red">
                Footer Pane
        <script type="text/javascript">
            var restrictionZone = $get('restrictionZone');
            function OnClientDragEnd(dock) {
                var restrBounds = $telerik.getBounds(restrictionZone);
                var dockBounds = $telerik.getBounds(dock.get_element());
                var inBounds = Telerik.Web.UI.ResizeExtender.containsBounds(restrBounds, dockBounds);
                if (!inBounds) {
                    if (dockBounds.x < restrBounds.x) {
                    else if (restrBounds.x + restrBounds.width < dockBounds.x + dockBounds.width) {
                        dock.set_left(restrBounds.x + restrBounds.width - dockBounds.width);
                    if (dockBounds.y < restrBounds.y) {
                    else if (restrBounds.y + restrBounds.height < dockBounds.y + dockBounds.height) {
                        dock.set_top(restrBounds.y + restrBounds.height - dockBounds.height);

    Thanks in advanced,
  2. Slav
    Slav avatar
    1351 posts

    Posted 24 Apr 2012 Link to this post

    Hi Shane,

    Note that a floating RadDock control is not a child of the RadPane, but of the page's body section and as such it will not be scrolled with the content of the pane control. To ensure that the RadDock will be a part of the RadPane's content and the scrollbar will affect it as well, I would suggest specifying a separate page as the content of the middle RadPane. You can find a sample project that demonstrates this setup.

    The RadWindow control has a built-in Restricted Zones functionality so you may consider using it instead, as it appears you are not utilizing the docking feature of RadDock. Nevertheless, if you want to persist the layout of the draggable sections through postback, you should stick to RadDock.

    Feel free to contact us again if you encounter more difficulties.

    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. DevCraft R3 2016 release webinar banner
Back to Top