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
close icon

Dynamically removing controls from DockingManager

I am trying to create new docked controls (my own user controls) in code at runtime.

I can create them fine but I'm not sure how I can programmatically remove them from the DockingManager. I've tried simply disposing the control but it kills the Controls array in the DockingManager which in turn breaks the display and eventually throws an error.

I can't seem to find anything on the DockingManager itself to unload or undock a control.

Any ideas what I can do?

thanks

1 Reply

VS Vallarasu S Syncfusion Team May 8, 2010 07:28 AM UTC

Hi Colin,

Thanks for your interest in Syncfusion products.

You can use SetEnableDocking method of DockingManager to dock or undock a control from the DockingManager as follows,

//To Dock a control
if(!dockingManager1.GetEnableDocking(listBox1))
dockingManager1.SetEnableDocking(listBox1, true);
//To Undock a control
if (dockingManager1.GetEnableDocking(listBox1))
dockingManager1.SetEnableDocking(listBox1, false);

Refer the sample at the following link which demonstrates the above

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=DockingManagerSample709357893.zip

Please let me know if i have misunderstood your question.

Regards
Vallarasu S.

Loader.
Live Chat Icon For mobile
Up arrow icon