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

RadDock dock and float issues

5 Answers 426 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Tung
Top achievements
Rank 1
Tung asked on 06 Apr 2017, 01:01 PM

Hi

I’m using the RadDock and have a few issues with docking and floating windows.

1. The default size for floating windows is 300 x 300. I know I can set the DefaultFloatingSize but I'd prefer if it stayed the same size as when it was docked. I’ve tried the FloatingWindowCreated event but can’t identify the tab on it as that hasn’t happened yet. Do you think it’s possible?

2. I can float a DocumentWindow or ToolWindow by double clicking the title bar but double clicking it again doesn't make it redock. I could use the MouseDoubleClick event to programmatically set the DockState but how do I check the user clicked the title bar?

3. If I redock a floating DocumentWindow with the ‘Dockable’ context menu option, it doesn't go to its original location. It goes to the first position of the topmost horizontal tab group. It's worse if I have one tab at the top with multiple tabs grouped underneath and float the top tab; it redocks next to the multiple tabs at the bottom and leaves a big empty space where it was located originally (see attached images). Note: the Dockable option works for ToolWindows; if I dock one ToolWindow on the left and another on the right, each redocks to the correct location.

I'm using version 2016.608.40 of RadDock and tried 2017.1.21.40 as well.

Regards

Tung

5 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 07 Apr 2017, 12:41 PM
Hi Tung,

Thank you for writing.

In order to set a floating size to a particular window, you need to work with its DefaultFloatingSize property. I can suggest iterating your windows and set the DefaultFloatingSize property for each of them.  

Double-clicking the title bar of a floating window will maximize it and this is the expected behavior in this scenario. I can suggest checking the following documentation articles showing how windows can be created and arranged:
The described behavior in your third question is also expected, in your to dock a document window you need to use the Tabbed Document option from the context menu.

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Tung
Top achievements
Rank 1
answered on 11 Apr 2017, 12:28 PM

Hi Hristo

1. I had to set the MinimumSize as well on e:Window in the FloatingWindowCreated event for it to work.

2. The documentation says double clicking the title bar should float a ToolWindow.

Mouse Support: "Double-clicking the title bar of a ToolWindow un-docks the panel so that it floats" (http://docs.telerik.com/devtools/winforms/dock/architecture-and-features/keyboard-and-mouse-support)

This is also stated in http://docs.telerik.com/devtools/winforms/dock/architecture-and-features/floating-windows.

And this does work for a ToolWindow and also for a DocumentWindow. But the same action doesn't unfloat the window. So I tried the ‘Dockable’ and 'Tabbed Document' context menu options expecting it to be an alternative method to double clicking the title bar but it doesn't redock the windows in their original position. This happens even when I use the RedockService.

Another issue is if I have a DocumentWindow at the top and two on the bottom and undock the top one, it leaves a blank space. Is this normal? I would prefer if the bottom one filled that empty space. And if I redock the floating DocumentWindow, it goes to the bottom instead of its original position. 

Are these bugs or expected behaviour? In either case how can I workaround this as it's not releasable at the moment.

Regards

Tung

0
Hristo
Telerik team
answered on 13 Apr 2017, 07:58 AM
Hi Tung,

Thank you for writing back.

I am glad that setting the MinimumSize fits well your local setup.

As observed double clicking on the tab strip floats a DocumentWindow as well as a ToolWindow. When the window is floating double clicking the tab strip docks only the tool windows. Please note that this behavior is intended.

I agree that the documentation article stating that the title-bar should be double clicked might be not entirely precise. The double click should be performed on the tab strip item located in the ToolTabStrip. Double clicking on the form`s title bar will maximize the window which is expected. 

The document windows can be floated, tabbed, or docked. Please check the following documentation article: The code snippet below shows how you can achieve docking a floating document window by double-clicking on the tab strip item located in the DocumentTabStrip. I am also attaching a short video showing the result on my end.
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
 
        this.radDock1.ActiveWindowChanged += RadDock1_ActiveWindowChanged;
    }
 
    private void RadDock1_ActiveWindowChanged(object sender, DockWindowEventArgs e)
    {
        if (this.radDock1.ActiveWindow is DocumentWindow && this.radDock1.ActiveWindow.DockState == DockState.Floating)
        {
            this.radDock1.ActiveWindow.DockTabStrip.MouseDoubleClick -= DockTabStrip_MouseDoubleClick;
            this.radDock1.ActiveWindow.DockTabStrip.MouseDoubleClick += DockTabStrip_MouseDoubleClick;
        }
    }
 
    private void DockTabStrip_MouseDoubleClick(object sender, MouseEventArgs e)
    {
        TabStripItem item = ((DocumentTabStrip)sender).ElementTree.GetElementAtPoint(e.Location) as TabStripItem;
        DockWindow window = item.TabPanel as DockWindow;
        if (window.DockState == DockState.Floating)
        {
            RedockService service = this.radDock1.GetService<RedockService>();
            service.RestoreState(window, DockState.Docked, true);
        }
    }
}

Please note that docking a document window will dock it in the document container. If it fits better your local setup you can choose to use the DockState.Tabbed setting which will display the window as a tabbed document.

Regarding your last question, the described behavior depends on how your layout has been arranged and where your document windows are docked. Please refer to the attached video file showing the dock layout.

I hope this information was useful. Should you have further questions please do not hesitate to write back.

Regards,
Hristo
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Tung
Top achievements
Rank 1
answered on 20 Apr 2017, 09:15 AM

Hi Hristo

We've decided to take the dock as it is and not spend more time customising it.

I still think it's more intuitive that a floating window docks back to its original position. Also if you float the window at the top, the bottom windows should automatically fill that space; this does happen if you float the bottom window. So maybe that's a bug?

Thanks for your time

Tung

0
Hristo
Telerik team
answered on 21 Apr 2017, 08:43 AM
Hi Tung,

Thank you for writing back.

It bottom windows will fill the empty space of a floated upper windows depending on how they are docked. For example, if both of the windows are arranged in the same pane the bottom window will fill the empty space. If the bottom window is docked elsewhere it will remain there. I am attaching a short video showing demonstrating the described behavior.

I hope this helps. Please let me know if you have other questions.

Regards,
Hristo
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Dock
Asked by
Tung
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Tung
Top achievements
Rank 1
Share this question
or