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

DockingManager abilities

Hello

I have 4 controls in UI of my application.
I'm using a DockingManager and all of the controls are docked as matrix.
I want to swap left top control with bottom right one.
For this aim I use DockControl method of DockingManager but controls are not docked as I need.
What is the right way to make a correct swapping?

Another question is how could I use the DockingManager but prevent from user the ability to drag controls?

Thanx a lot!


1 Reply

J. J.Nagarajan Syncfusion Team November 29, 2007 12:30 AM UTC

Hi Corrado ,

Thanks for your interest in SYncfusion products.

1. If your intention is to change the order of the controls in dock layout then please refer to the following code snippet.

[C#]

DockHost dh = this.panel1.Parent as DockHost;
DockHostController dhc = dh.InternalController as DockHostController;
DockInfo di = dhc.DINew;
di.DP = DockPreference.Vertical;//.Vertical;
di.nDockIndex = 2;
di.nPriority = 0;
dhc.DINew = new DockInfo(di);
dhc.ApplyDockInfo();
di.dController.AdjustLayout();

DockHost dh1 = this.panel3.Parent as DockHost;
DockHostController dhc1= dh1.InternalController as DockHostController;
DockInfo di1 = dhc1.DINew;
di1.DP = DockPreference.Tabbed;//.Vertical;
di1.nDockIndex = 0;
di1.nPriority = 0;
dhc1.DINew = new DockInfo(di1);
dhc1.ApplyDockInfo();
di1.dController.AdjustLayout();


2. You can prevent the dragging of dock control by handling the DragAllow event. Please refer to the following code snippet.

[C#]

private void dockingManager1_DragAllow(object sender, DragAllowEventArgs arg)
{
if (arg.Control is Panel)
{
arg.Cancel = true;
}
}


Please let me knwow if you have any questions.

Regards,
Nagaraj


Loader.
Live Chat Icon For mobile
Up arrow icon