RadPanels xaml and dynamic

2 posts, 0 answers
  1. Shannon Fender
    Shannon Fender avatar
    4 posts
    Member since:
    Mar 2007

    Posted 27 Apr 2009 Link to this post

    Hello, I'm trying to use RadSplitpanels / RadPanels / Docking.
    Basically, i have 1 "Main" pane. setup as the DocumentHost.

    When the user first hits the page, i'd like 3 panes to Defualt to being shown on the screen, docked at various parts of the "Main" pane. User should be allowed to close the Docked Panels, Move them, group them, etc.. and click a button to get any closed panes back.

    this all sounds easy, but it isn't quite working as i was expecting.

    here a code sample:




            <telerikDocking:RadDocking x:Name="docking" Margin="-8,0,8,0" > 
                                <RowDefinition /> 
                            <!- Other Content goes here -> 
                            <Button Grid.Row="1" VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="20,0,0,0" Content="Open pane 1" Height="20" Width="160" Click="Button_Click"/>  
                            <Button  Grid.Row="1" VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="180,0,0,0"  Content="Open pane 2" Height="20" Width="160" Click="Button2_Click"/>  
                            <Button Grid.Row="1"  VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="340,0,0,0" Content="Open pane 3" Height="20" Width="160" Click="Button3_Click"/>  
                <telerikDocking:RadSplitContainer InitialPosition="DockedRight" x:Name="split1" Orientation="Vertical">  
                    <telerikDocking:RadPaneGroup x:Name="group1">  
                        <telerikDocking:RadPane x:Name="pane1" /> 
                        <telerikDocking:RadPaneGroup x:Name="group2">  
                            <telerikDocking:RadPane x:Name="pane2" /> 
                <telerikDocking:RadSplitContainer InitialPosition="DockedBottom" x:Name="split2" Orientation="Horizontal">  
                    <telerikDocking:RadPaneGroup x:Name="group3">  
                        <telerikDocking:RadPane x:Name="pane3" /> 

    it seems that when a pane is docked & pinned, clickign the "Close" (X) button in the pane will hide the pane. I have had success with making them Re-appear.
    But, if the user has undocked the pane, and then closed it. there seems to be no way to get it to reappear.

    the following code only seems to work one time.


    MyUserControl uc1 = new MyUserControl();  
                uc1.InitialPosition = Telerik.Windows.Controls.Docking.DockState.FloatingDockable;  
    "MyUserControl" in this case is a usercontrol inheriting from RadSplitContainer.

    Am i just going about this completely wrong? or is this a limitation of the control? if i'm completely wrong, a code sample showing what i'm tryin to accomplish would be appreciated.

  2. Miroslav Nedyalkov
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 28 Apr 2009 Link to this post

    Hello Shannon Fender,

    I'm not quite sure that I understand what you are trying to do, but I'll try to help where I understand.

    The DocumentHost property expects a RadSplitContainer (or something that inherits from RadSplitContainer). If you put the DockingPanel control around your Grid because of the Docking control, you can remove it - the Docking control doesn't need it. The other XAML looks OK.

    About the problem with your control that inherits from the RadSplitContainer control: first of all we really don't recommend inheriting the controls if this is not necessary. If you are sure that you need to inherit it, you could use the following code to set the position of the uc1:
    Telerik.Windows.Controls. RadDocking.SetDockState(uc1, Telerik.Windows.Controls.Docking.DockState.FloatingDockable) 

    About the reshowing panes in all cases you can use the following static method (just add it where it is more comfortable for you):
    static void ShowPane(RadPane pane) 
        if (pane.IsHidden) 
            pane.IsHidden = false
        var parentWindow = pane.ParentOfType<Telerik.Windows.Controls.Docking.ToolWindow>(); 
        if (parentWindow != null && parentWindow.Visibility == Visibility.Collapsed) 
            bool isDockable = pane.IsDockable; 
            if (!isDockable) 
            if (isDockable) 

    I could recommend you to see our online demos and their code at

    as well as take a look at this blog post

    demonstrating the docking control Save/Load capabilities (it also shows how to create a simple application with the Docking control).

    Hope this helps and if you have further questions, please don't hesitate to ask.

    Miroslav Nedyalkov
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
Back to Top