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

Moving Panels between dockmanagers

2 Answers 84 Views
Dock
This is a migrated thread and some comments may be shown as answers.
kortm
Top achievements
Rank 1
kortm asked on 04 Apr 2007, 01:46 PM

Hello,

I have two dock managers in two different tabs and I try to move panel from one dock manager to the other.

private void dockPanel_MoveToManager(object sender, MouseEventArgs e)

{//MyPanel was in dockmanager2 and I want to move it to dockmanager1
DockPanel MyPanel = (DockPanel)sender;
this.dockingManager1.SetDock(MyPanel,DockPosition.Bottom);
this.dockingManager2.Remove(MyPanel);
}
Is that possible?

Thanks,

KORT

2 Answers, 1 is accepted

Sort by
0
Vincent
Top achievements
Rank 1
answered on 04 Apr 2007, 02:12 PM
Hello,

you can move the panel without removing it.
but what about its child controls?
Any ideas on how to do that ?

thanks,
0
Julian Benkov
Telerik team
answered on 04 Apr 2007, 04:10 PM
Hello Vincent,

Your code is correct, but you will need to change the order of  the Remove and SetDock calls:

private void dockPanel_MoveToManager(object sender, MouseEventArgs e)

{//MyPanel was in dockmanager2 and I want to move it to dockmanager1
DockPanel MyPanel = (DockPanel)sender;

this.dockingManager2.Remove(MyPanel);
this.dockingManager1.SetDock(MyPanel,DockPosition.Bottom);

}


In this case all child controls will be safe.
 

Kind regards,
Julian Benkov
the telerik team

Instantly find answers to your questions at the new telerik Support Center
Tags
Dock
Asked by
kortm
Top achievements
Rank 1
Answers by
Vincent
Top achievements
Rank 1
Julian Benkov
Telerik team
Share this question
or