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

Minwidth problem when saving/loading

5 Answers 133 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Jose
Top achievements
Rank 1
Jose asked on 22 Feb 2011, 05:25 PM
Hi,

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

Sort by
0
George
Telerik team
answered on 25 Feb 2011, 01:16 PM
Hi Jose,

 
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.

Best wishes,
George
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Jose
Top achievements
Rank 1
answered on 28 Feb 2011, 10:24 PM
Hi,

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
0
George
Telerik team
answered on 03 Mar 2011, 01:03 PM
Hello 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.

Regards,
George
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Jose
Top achievements
Rank 1
answered on 07 Mar 2011, 08:17 PM
Hi,

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.
0
George
Telerik team
answered on 10 Mar 2011, 06:35 PM
Hi Jose,

 
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.


Greetings,
George
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Docking
Asked by
Jose
Top achievements
Rank 1
Answers by
George
Telerik team
Jose
Top achievements
Rank 1
Share this question
or