This is a migrated thread and some comments may be shown as answers.

Dynamically created RadDockZone (issue)

3 Answers 112 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Erik
Top achievements
Rank 1
Erik asked on 10 Mar 2010, 07:41 PM
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);
}

3 Answers, 1 is accepted

Sort by
0
Petio Petkov
Telerik team
answered on 15 Mar 2010, 02:42 PM
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.
0
Erik
Top achievements
Rank 1
answered on 18 Mar 2010, 06:10 PM
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.
0
Pero
Telerik team
answered on 23 Mar 2010, 10:38 AM
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.
Tags
Dock
Asked by
Erik
Top achievements
Rank 1
Answers by
Petio Petkov
Telerik team
Erik
Top achievements
Rank 1
Pero
Telerik team
Share this question
or