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

Windows restored to their original size after docking.

5 Answers 51 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Frank
Top achievements
Rank 1
Frank asked on 20 Sep 2011, 12:10 AM
Is there a way to have RadPanes restored to their original size after they been "undocked"?  If I dock a floating window, then undock it, the RadPane's size is not restored to the previous size.  All RadPanes are resized to the same small size, regardless of their original dimensions.

5 Answers, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 22 Sep 2011, 12:33 PM
Hi Frank,

In order to achieve this, you need to set the size of the ToolWindows every time they are created. You can do this like so:
- first get the ToolWindow

private ToolWindow GetToolWindow(RadPane pane)
{
    ToolWindow window = pane.ParentOfType<ToolWindow>();
    if (window == null)
    {
        window = (((pane.Parent as RadPaneGroup).Parent as RadSplitContainer).Parent) as ToolWindow;
    }
    return window;
}

- after that in the PaneStateChange event set the desired size:

private void radDocking_PaneStateChange(object sender, Telerik.Windows.RadRoutedEventArgs e)
{
    foreach (RadPane pane in radDocking.Panes)
    {
        if (pane != null && pane.IsFloating)
        {
            ToolWindow toolWindow = GetToolWindow(pane);
            toolWindow.Height = 20;
            toolWindow.Width = 20;
        }
    }
}

Hope this helps.

Greetings,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Frank
Top achievements
Rank 1
answered on 23 Sep 2011, 09:59 PM
Konstantina,

Thanks for the example, this seems to work, but only part of the time.  When it works, it works fine.  However, about half of the time the window does not get restored to the proper size on the screen.  The window actually "knows" its proper size because if you try to resize it with the mouse, it will "jump" to that size before updating.  Meaning that the window's data contains the correct values, but there appears to be a glitch in the rendering of the control on the screen.  Is there a way to force a control (the window) to be redrawn on the screen?  Perhaps something after InvalidateMeasure() is called?

Thanks,
Frank
0
Konstantina
Telerik team
answered on 29 Sep 2011, 08:52 AM
Hello Frank,

Sorry, but I wasn't able to reproduce the behaviour you are describing. However, I can suggest you even better approach - instead of writing GetToolWindow() method, you could use the build-in one, which is faster and more clearer.

private void radDocking_PaneStateChange(object sender, Telerik.Windows.RadRoutedEventArgs e)
       {
           var pane = e.OriginalSource as RadPane;
           if (pane != null)
           {
                       var toolWindow = pane.GetParentToolWindow();
                       if (toolWindow != null)
                       {
                           toolWindow.Height = 100;
                           toolWindow.Width = 100;
                       }
             }
       }


Please try with it and let us know if that resolved the issue. If you still experience it, could you please try to reproduce it in a sample project and send it back to us. In that way we will be able to track down the source of the problem and provide you with a solution in a timely manner.

Greetings,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Ben
Top achievements
Rank 1
answered on 02 Dec 2014, 11:44 PM
Just wanted to confirm Frank's issue (despite 3 years having passed) where the control still needs an 'InvalidateMeasure' or some sort of redraw after resizing the tool window. The change will not propagate until clicking the window with a mouse.
0
Kalin
Telerik team
answered on 05 Dec 2014, 12:33 PM
Hi Eddie,

We are not aware of the explained issue and were not able to reproduce it. Can you please share some sample code and a video demonstrating the exact scenario? This way we will be able to observe that behavior on our side and think of possible solution.

I'm looking forward to hearing from you.

Regards,
Kalin
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.

 
Tags
Docking
Asked by
Frank
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Frank
Top achievements
Rank 1
Ben
Top achievements
Rank 1
Kalin
Telerik team
Share this question
or