How do i undock controls set in design and redock them as a tabbed group during execution.
I have the Controls in a tabbed group at the bottom of the parent. If I use
I am trying
_DockingManager.SetEnableDocking(Control1,false);
_DockingManager.SetEnableDocking(Control2,false);
Syncfusion.Windows.Forms.Tools.DockHost dhost = new DockHost(_DockingManager,Control1);
dhost.Controls.Add(Control2);
_DockingManager.DockControl(dhost,this,Syncfusion.Windows.Forms.Tools.DockingStyle.Bottom,Control1.Height);
_DockingManager.SetDockVisibility(Control1,true);
_DockingManager.SetDockVisibility(Control2,true);
however they do not appear in the same group, but stacked from the bottm up. Also after this if I call _DockingManager.GetDockVisibility(Control2);
i get
An unhandled exception of type ''System.NullReferenceException'' occurred in syncfusion.tools.dll
SIGN IN To post a reply.
5 Replies
AD
Administrator
Syncfusion Team
February 5, 2004 05:54 PM UTC
Hi Vinod,
Please refer to the sample code attached. I have undocked the docking windows from their design-time positions and have docked them as a tabbed group at the bottom at runtime. Click the ''Dock as Tabbed Group'' MainMenu item to trigger this. In response to the menu item click event, I do the following :
this.dockingManager1.DockControl(this.panel1, this, DockingStyle.Bottom, 120);
this.dockingManager1.DockControl(this.panel2, this.panel1, DockingStyle.Tabbed, 120);
Note that the second control is docked to the first control in Tabbed DockingStyle, and not to the main form as it is in the case of the first control.
There is also a GetDockVisibility menu item and you could click that to get the Visibility status of the controls at any time.
In your code above, make the following changes, and it might work fine.
_DockingManager.DockControl(dhost,this.Control1,Syncfusion.Windows.Forms.Tools.DockingStyle.Tabbed,Control1.Height);
Please let me know if you need any additional information. Thanks for considering Syncfusion products.
Regards,
Guru Patwal
Syncfusion, Inc.
AD
Administrator
Syncfusion Team
February 10, 2004 07:51 PM UTC
Thanks Guru,
That worked perfect. One last question. If I need to dock two controls to the left side but i want one to occupy the top half and the second control to occupy the space below that(lower half). But I need both to be docked on the left side. How do I accomplsh that using DockingStyle.Left.
Do I use the Dock size?
Thanks V
AD
Administrator
Syncfusion Team
February 10, 2004 09:01 PM UTC
Hi Vinod,
Thanks for the update. You could dock two controls as per your specifications by using this code below :
this.dockingManager1.DockControl(this.panel1, this, DockingStyle.Left, 150);
this.dockingManager1.DockControl(this.listBox1, this.panel1, DockingStyle.Bottom, 150);
Assume that panel1 and listBox1 are two controls that you wish to dock. A complete sample illustrating this is attached here. Please refer to the sample and let me know if you need any additional information.
Regards,
Guru Patwal
Syncfusion, Inc.
AD
Administrator
Syncfusion Team
February 11, 2004 12:19 PM UTC
Thanks Guru for the quick turn arround. It works exactly as i need it.
Thanks again
Vinod
AD
Administrator
Syncfusion Team
February 11, 2004 01:41 PM UTC
Hi Vinod,
In future please address all your technical support related questions through Direct Trac as far as possible. We appreciate your cooperation, and thanks for choosing Syncfusion products.
Regards,
Guru Patwal
Syncfusion, Inc.
SIGN IN To post a reply.
- 5 Replies
- 2 Participants
-
VI Vinood
- Feb 5, 2004 04:30 PM UTC
- Feb 11, 2004 01:41 PM UTC