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

How to avoid that MID children can be place outside racDock parent window?

1 Answer 30 Views
Dock
This is a migrated thread and some comments may be shown as answers.
FMorales
Top achievements
Rank 1
FMorales asked on 19 Jun 2015, 07:25 AM

Hi, 

I have a main windows form that includes a racDock with the "AutoDetectMdiChildren" to true.

I need that children MDI winform can be only docked inside the racDock area, so, I would like that the user can dock the MID child form to the top/botton/left/right but not be able to extract the windows to another independent windows outside the parent form where is the racDock control.

How can I disable that the MDI child form could be outside of the parent form?.

Thanks a lot.

Francisco

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 22 Jun 2015, 10:34 AM
Hello Francisco,

Thank you for writing.

In order to achieve your goal, you can use set the RadDock.DragDropMode property to Preview and cancel the DockStateChanging event if the DockStateChangingEventArgs.NewDockState is DockState.Floating:
public Form1()
{
    InitializeComponent();
    this.IsMdiContainer = true;
    this.radDock1.AutoDetectMdiChildren = true;
    this.radDock1.DragDropMode = Telerik.WinControls.UI.Docking.DragDropMode.Preview;
    this.radDock1.DockStateChanging+=radDock1_DockStateChanging;
}
 
private void radDock1_DockStateChanging(object sender, Telerik.WinControls.UI.Docking.DockStateChangingEventArgs e)
{
    e.Cancel = e.NewDockState == Telerik.WinControls.UI.Docking.DockState.Floating;
}

I hope this information helps. Should you have further questions, I would be glad to help.
 
Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Dock
Asked by
FMorales
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or