Disable the floating feature

8 posts, 0 answers
  1. Yuk Hei
    Yuk Hei avatar
    5 posts
    Member since:
    Nov 2014

    Posted 23 Feb 2015 Link to this post

    I want to disable the floating feature, but i want to remain the docking feature when using the radDock. How can i do that?
  2. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 23 Feb 2015 Link to this post

    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.

     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Yuk Hei
    Yuk Hei avatar
    5 posts
    Member since:
    Nov 2014

    Posted 23 Feb 2015 in reply to Stefan Link to this post

    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.


  5. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 25 Feb 2015 Link to this post

    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.

     
  6. Yuk Hei
    Yuk Hei avatar
    5 posts
    Member since:
    Nov 2014

    Posted 26 Feb 2015 in reply to Stefan Link to this post

    But it seems it will also make the drag drop function disabled.
    so i cannot dock the window to other position.
  7. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 26 Feb 2015 Link to this post

    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.

     
  8. Yuk Hei
    Yuk Hei avatar
    5 posts
    Member since:
    Nov 2014

    Posted 27 Feb 2015 in reply to Stefan Link to this post

    That is what i need!!!
    Thank for your help :D
  9. Yuk Hei
    Yuk Hei avatar
    5 posts
    Member since:
    Nov 2014

    Posted 27 Feb 2015 in reply to Stefan Link to this post

    That is what i need!!!
    Thank for your help :D
Back to Top
UI for WinForms is Visual Studio 2017 Ready