Dynamically created RadDockZone (issue)

4 posts, 0 answers
  1. Erik
    Erik avatar
    43 posts
    Member since:
    Feb 2009

    Posted 10 Mar 2010 Link to this post

    I've been attempting to dynamically create an RDZ, bascially the same way I created my dynamic RadDocks with no luck.  I can dynamically create RadDocks and add them to an existing RDZ that's already on the page, but when I try to add RadDocks to a dynamically created RDZ nothing happens.  Well I do get one error as such from my ScriptManager:

    base {System.SystemException} = {"Page cannot be null. Please ensure that this operation is being performed in the context of an ASP.NET request."}

    Any ideas what I'm missing here?  I also tried to create the RDZ in the page_init with the same result fwiw.

    private RadDock CreateRadDock()
     {
    RadDock dock = new RadDock();
                dock.ID = string.Format("RadDock{0}",  Session["Tid"].ToString());
                dock.Title = string.Format("Dock {0}",  Session["Tname"].ToString());
       //other attributes here



    RadDockZone newRadDockZone = new RadDockZone();



    newRadDockZone.ID = string.Format("ctl00_ContentPlaceHolder1_RadDockZone{0}", +(4));
                                newRadDockZone.ID = string.Format("ctl00_ContentPlaceHolder1_RadDockZone{0}", +(4));
                                newRadDockZone.UniqueName = string.Format("RadZone{0}", +(4));
                                newRadDockZone.MinHeight = Unit.Pixel(200);
                                newRadDockZone.MinWidth = Unit.Pixel(400);
                                newRadDockZone.Skin = "Default2006";

    newRadDockZone.Controls.Add(dock);
    }
  2. Petio Petkov
    Admin
    Petio Petkov avatar
    825 posts

    Posted 15 Mar 2010 Link to this post

    Hi Erik,

    The code that you posted looks OK and at this point we cannot tell what the reason for the problem might be. Here is a simple code which I tested and everything is working as expected:
    protected override void OnInit(EventArgs e)
      {
          base.OnInit(e);
          RadDockZone rdz = new RadDockZone();
          rdz.ID = string.Format("ctl00_ContentPlaceHolder1_RadDockZone{0}", +(4));
          rdz.UniqueName = string.Format("RadZone{0}", +(4));
            
          RadDock rd = new RadDock();
          rd.ID = "RadDock1";
          rdz.Controls.Add(rd);
          RadDockLayout1.Controls.Add(rdz);
      }

    Please open a support ticket and send us a small sample project where the problem could be reproduced so we could investigate further.

    Regards,
    Petio Petkov
    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. UI for ASP.NET Ajax is Ready for VS 2017
  4. Erik
    Erik avatar
    43 posts
    Member since:
    Feb 2009

    Posted 18 Mar 2010 Link to this post

    Petio,
    Thanks for the response on this.  From your code below it looks like the issue is that I'm not using the RadDockLayout1 as you are.  In fact when dropping the RDZ's on the html side, I didn't even need the layout control.  But, it appears that dynamically doing this wont work without one.
  5. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 23 Mar 2010 Link to this post

    Hello Erik,

    You should always use RadDockLayout control, when creating an application that contains RadDocks and RadDockZones. This control manages the states of the registered docks and zones - makes sure the docks are placed in the right zone and correct index.

    Greetings,
    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