I am using the docking control, I have set the min width on the RadSplitContainer. But when I load the saved file the min width is not applied to the docking control.
I am missing something I need to do in order for this to work?
Thanks
Jose
5 Answers, 1 is accepted
I would suggest you to set RadDocking.SerializationTag to the RadSplitContainers, RadPaneGroups and RadPanes. Please, refer to the following link - http://www.telerik.com/help/wpf/raddocking-features-save-load-layout.html
I hope this helps.
George
the Telerik team
Excelent! it seems to be working now!! But now I have other problem, once you make the panel float then dock it on the same place, the minwidth stop working.
I have tried doing it on code behind but it didnt work either? I am missing something?
Thanks
Jose
Could you confirm that this is the same place? Please, pay attention to that when a pane is docked without RadPaneGroup, a new group will be created.
Could you please give us some more information bout your scenario? I am glad to assist you further.
George
the Telerik team
Here is a code sniped of telerik control I have.
<
telerik:RadDocking
x:Name
=
"Docking"
Grid.Row
=
"2"
Grid.ColumnSpan
=
"2"
telerik:RadDocking.SerializationTag
=
"DockingRadDocking"
telerikQuickStart:ThemeAwareBackgroundBehavior.IsEnabled
=
"True"
>
<
telerik:RadDocking.DocumentHost
>
<
telerik:RadSplitContainer
telerik:RadDocking.SerializationTag
=
"CanvasRadSplitContainer"
>
<
telerik:RadPaneGroup
telerik:RadDocking.SerializationTag
=
"CanvasRadPaneGroup"
>
<
telerik:RadDocumentPane
Visibility
=
"Collapsed"
Name
=
"LayoutCanvas"
ContextMenuTemplate
=
"{x:Null}"
telerik:RadDocking.SerializationTag
=
"CanvasRadDocumentPane"
CanFloat
=
"False"
CanUserClose
=
"False"
CanDockInDocumentHost
=
"False"
CanUserPin
=
"False"
>
<
telerik:RadPane.Content
>
...Content....
</
telerik:RadPane.Content
>
</
telerik:RadDocumentPane
>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
</
telerik:RadDocking.DocumentHost
>
<
telerik:RadSplitContainer
MaxWidth
=
"700"
MinWidth
=
"400"
InitialPosition
=
"DockedRight"
telerik:RadDocking.SerializationTag
=
"PropertiesRadSplitContainer"
>
<
telerik:RadPaneGroup
telerik:RadDocking.SerializationTag
=
"PropertiesRadPaneGroup"
>
<
telerik:RadPane
ContextMenuTemplate
=
"{x:Null}"
Name
=
"LayoutPropertiesPanel"
CanUserClose
=
"False"
telerik:RadDocking.SerializationTag
=
"PropertiesRadPane"
>
...Content...
</
telerik:RadPane
>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
</
telerik:RadDocking
>
So when I open the app, it will load the saved file and it is working fine. But then, when you undock then dock it again, it will not get the minwidth.
As I said, when you undock the pane and dock it again, a new RadPaneGroup and a new RadSplitContainer are generated. This is the reason why the RadSplitContainer is no longer with MinWidth. To work around it, I would suggest you to set MinWidth for each RadSplitContainer, when the Pane is pinned. You could handle PaneStateChanged event and check when the Pane is pinned, get the RadSplitContainer using RadPane.ParentOfType<RadSplitContainer>(); and set MinWidth. For example:
private
void
RadDocking_PaneStateChange(
object
sender, RadRoutedEventArgs e)
{
var pane = e.OriginalSource
as
RadPane;
if
(pane !=
null
&& pane.IsPinned)
{
var splitContainer = pane.ParentOfType<RadSplitContainer>();
if
(splitContainer !=
null
)
{
splitContainer.MinWidth = 400;
}
}
}
I hope this helps.
George
the Telerik team