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
0
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
- after that in the PaneStateChange event set the desired size:
Hope this helps.
Greetings,
Konstantina
the Telerik team
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
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
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.
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
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
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
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.