We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Enable / Disable Docking at runtime

Hi,

we have a form with three docked controls (all three controls are docked on the left side).

Now I want to disable (hide) all three controls with a click on the menu. Furthermore I want to bring them back (docked again on the left side) with another click on the menu.

How can I solve this - any help would be great?


Thanks in advance,

Chris

1 Reply

MU Murugan Syncfusion Team December 18, 2006 02:58 PM UTC

Hi Chris,

Thanks for choosing Syncfusion products.

DockingManager.SetDockVisibility method shows/hides the docked control and keeps the DockingStyle also.

To show a docked control DockingManager.SetDockVisibility( ctrl , true );

To hide a docked control DockingManager.SetDockVisibility( ctrl , false );

Here is the code snippet for your query:

private void barItem1_Click(object sender, EventArgs e)
{
if (this.barItem1.Checked)
{
this.dockingManager1.SetDockVisibility(this.panel1, false);
this.dockingManager1.SetDockVisibility(this.panel2, false);
this.dockingManager1.SetDockVisibility(this.panel3, false);
this.barItem1.Checked = false;
}
else
{
this.dockingManager1.SetDockVisibility(this.panel1, true);
this.dockingManager1.SetDockVisibility(this.panel2, true);
this.dockingManager1.SetDockVisibility(this.panel3, true);
this.barItem1.Checked = true ;
}
}

Please use this code and let me know if the issue is resolved.

Regards,
Murugan P.S

Loader.
Live Chat Icon For mobile
Up arrow icon