How do I add a DockZone to a Dock?

5 posts, 0 answers
  1. Christoffer Rosenqvist
    Christoffer Rosenqvist avatar
    28 posts
    Member since:
    Oct 2009

    Posted 26 Oct 2009 Link to this post

    I have a RadDockLayout where I have a DockZone. Inside this DockZone I add a Dock - so far, so good - now I want to add a new DockZone to the Dock and thus allow nested Docks. All of this happens programmatically from code behind.

    So far I haven't succeeded. How is this done? Where do I add the new DockZone to the Dock? Do I add it to the Controls-collection or somehow to the ContentTemplate? Please illustrate with an example.

    Thanks!
  2. Christoffer Rosenqvist
    Christoffer Rosenqvist avatar
    28 posts
    Member since:
    Oct 2009

    Posted 27 Oct 2009 Link to this post

    It seems the method is this:
    dock.ContentContainer.Controls.Add(dockZone); 

    Correct?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Christoffer Rosenqvist
    Christoffer Rosenqvist avatar
    28 posts
    Member since:
    Oct 2009

    Posted 27 Oct 2009 Link to this post

    I have yet another problem: I add a DockZone to a Dock using the previous code, then I add a Dock to the new DockZone - no problem. The problem is that when I move the Dock out from the dynamically created DockZone I can't move it back in. The DockZone won't accept any Docks to be dropped inside it. Is it lacking any parameters then?

    Here is my code:

            private void AddTargetGroupDockZone(RadDock dock) { 
                RadDockZone dockZone = CreateDockZone(); 
                dockZone.MinHeight = Unit.Pixel(70); 
                dockZone.Width = Unit.Pixel(500); 
                dock.ContentContainer.Controls.Add(dockZone); 
            } 
     
            private RadDockZone CreateDockZone() { 
                RadDockZone dockZone = new RadDockZone(); 
                dockZone.UniqueName = Guid.NewGuid().ToString(); 
                dockZone.ID = string.Format(DockZoneIDFormat, dockZone.UniqueName); 
                return dockZone; 
            } 

  5. Christoffer Rosenqvist
    Christoffer Rosenqvist avatar
    28 posts
    Member since:
    Oct 2009

    Posted 27 Oct 2009 Link to this post

    It seems that if I add the "main" RadDockZone to the ForbiddenZones of the inner most Docks everything seems to be working as it should. Don't understand why though. Explanation?

    dock.ForbiddenZones = new[] { rdzMain.UniqueName }; 

  6. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 29 Oct 2009 Link to this post

    Hello Christoffer,

    If you want to add controls to the RadDock, you need to add them to the Controls collection of the dock's ContentContainer, exactly like you have done in some of your previous posts.

    The problem with the dock not docking in the correct zone might be caused by the fact that the docks are not correctly associated with the ID of the dynamically created RadDockZone. Please use the same value for the zone.UniqueName and zone.ID. If this does not solve the problem, please open a new support ticket and send us a sample running project where the problem can be observed.


    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017