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

Arranging windows programmatically

2 Answers 92 Views
Docking
This is a migrated thread and some comments may be shown as answers.
C Bates
Top achievements
Rank 1
C Bates asked on 16 Dec 2009, 01:15 PM
Hello,
I have an application using RadDocking like this:
<!--  Docking Area  --><docking:RadDocking Grid.Row="1" >    <docking:RadDocking.DocumentHost>        <docking:RadSplitContainer x:Name="splitContainer1">            <docking:RadPaneGroup x:Name="toolsGroup" >                <!--  First Panel  -->                <docking:RadPane x:Name="Panel1" Header="One" CanUserClose="False"  CanDockInDocumentHost="False">                    <docking:RadPane.Content>                        <StackPanel Orientation="Vertical">                            <!-- Some stuff -->                        </StackPanel>                    </docking:RadPane.Content>                </docking:RadPane>                <!-- Options Pane -->                <docking:RadPane x:Name="Panel2" Header="Two" CanDockInDocumentHost="False" CanUserClose="False">                    <nav:RadPanelBar x:Name="OptionsPanel" Background="AliceBlue"/>                </docking:RadPane>            </docking:RadPaneGroup>            <docking:RadPaneGroup x:Name="contentGroup">                <!-- The Content window -->                <!-- RadDocumentPanes added here -->            </docking:RadPaneGroup>        </docking:RadSplitContainer>    </docking:RadDocking.DocumentHost></docking:RadDocking>
I would like my app to start with Panel1 and Panel2 docked to the left side of the window, unpinned.
Can I do this programatically?
I have tried this, to no effect:
  splitContainer1.Items.Remove(toolsGroup);  splitContainer1.AddItem(toolsGroup, DockPosition.Left, mapGroup);  toolsGroup.HideAllPanes();
I have tried to manipulate Panel1 and Panel2 the same way, but they are not the right types for splitContainer1.AddItem().
Thanks for any hints...

2 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 18 Dec 2009, 11:42 AM
Hello C Bates,

 I couldn't fully understand what you want to achieve, but you shouldn't need to use code-behind in order to setup the initial state of the Docking control - appropriate XAML should be enough. If you want your panes to be initially unpinned you could use the IsPinned property of the RadPane control and set it to False. In your code you call the HideAll method and this makes me think you want to hide them. In order to do this you could set the IsHidden property of the RadPane control to true. If you want to be able to initially unpin the pane you should put them out of the DocumentHost area. You can achieve this by adding a RadSplitContainer control outside the DocumentHost property. Here is an example of what I mean:

<telerikDocking:RadDocking Grid.Row="1">
    <telerikDocking:RadSplitContainer InitialPosition="DockedLeft">
        <telerikDocking:RadPaneGroup x:Name="toolsGroup">
            <!--  First Panel  -->
            <telerikDocking:RadPane x:Name="Panel1" Header="One" CanUserClose="False"
                    IsPinned="False" CanDockInDocumentHost="False">
                <telerikDocking:RadPane.Content>
                    <StackPanel Orientation="Vertical">
                        <!-- Some stuff -->
                    </StackPanel>
                </telerikDocking:RadPane.Content>
            </telerikDocking:RadPane>
            <!-- Options Pane -->
            <telerikDocking:RadPane x:Name="Panel2" Header="Two"
                    CanDockInDocumentHost="False" IsHidden="True" CanUserClose="False">
                <telerikNavigation:RadPanelBar x:Name="OptionsPanel" Background="AliceBlue" />
            </telerikDocking:RadPane>
        </telerikDocking:RadPaneGroup>
    </telerikDocking:RadSplitContainer>
    <telerikDocking:RadDocking.DocumentHost>
        <telerikDocking:RadSplitContainer x:Name="splitContainer1">
            <telerikDocking:RadPaneGroup x:Name="contentGroup">
                <!-- The Content window -->
                <!-- RadDocumentPanes added here -->
            </telerikDocking:RadPaneGroup>
        </telerikDocking:RadSplitContainer>
    </telerikDocking:RadDocking.DocumentHost>
</telerikDocking:RadDocking>

Greetings,
Miroslav Nedyalkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
C Bates
Top achievements
Rank 1
answered on 18 Dec 2009, 12:53 PM
Thank you, very helpful.
Tags
Docking
Asked by
C Bates
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
C Bates
Top achievements
Rank 1
Share this question
or