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

Disable the floating feature

6 Answers 539 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Ramon Chan
Top achievements
Rank 1
Ramon Chan asked on 23 Feb 2015, 07:58 AM
I want to disable the floating feature, but i want to remain the docking feature when using the radDock. How can i do that?

6 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 23 Feb 2015, 09:28 AM
Hello Yuk,

Thank you for writing.

Please refer to the following article where you can find the information needed: AllowedDockStates | UI for WinForms Documentation.

I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.

Regards,
Stefan
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Ramon Chan
Top achievements
Rank 1
answered on 23 Feb 2015, 10:08 AM
Hello,
this only can remove the floating option form the context menu.

What i want is also disable the floating when i drag and drop the window.
For example, when i drag the window out, and drop it, it will not become a floating window.
I hope it can become the docking window which dock to the closest area.


0
Stefan
Telerik team
answered on 25 Feb 2015, 08:14 AM
Hello,

Setting the AllowedDockState for a window to exclude the floating option, will prevent the window from floating no matter how, and will also remove the option  from the context menu. I have just tested this once again and can confirm that.

To prevent any window from floating you can just iterate the windows and set their AllowedDockState property:
foreach (DockWindow dw in radDock1.DockWindows)
{
    dw.AllowedDockState = ~AllowedDockState.Floating;
}

I hope that you find this information useful.

Regards,
Stefan
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Ramon Chan
Top achievements
Rank 1
answered on 26 Feb 2015, 08:32 AM
But it seems it will also make the drag drop function disabled.
so i cannot dock the window to other position.
0
Stefan
Telerik team
answered on 26 Feb 2015, 02:40 PM
Hi,

That is correct. This will disable the floating function and you will only be able to rearrange tabs of DocumentWindows.

Going through the thread again I think I misunderstood you initially. What I can offer for this case is to remove the previously provided code and use the preview drag mode of the windows together with the TransactionCommiting event:
DragDropService service = this.radDock1.GetService<DragDropService>();
service.DragDropMode = DragDropMode.Preview;
radDock1.TransactionCommitting += radDock1_TransactionCommitting;
 
…..…...
void radDock1_TransactionCommitting(object sender, RadDockTransactionCancelEventArgs e)
{
     e.Cancel = e.Transaction is FloatTransaction;
}

More on the drag drop service can be found here: http://www.telerik.com/help/winforms/dock-architecture-and-features-using-the-dragdropservice.html

I hope that you find this information useful.

Regards,
Stefan
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Ramon Chan
Top achievements
Rank 1
answered on 27 Feb 2015, 06:41 AM
That is what i need!!!
Thank for your help :D
Tags
Dock
Asked by
Ramon Chan
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Ramon Chan
Top achievements
Rank 1
Share this question
or