FloatingLocation with nested docking (Q2)

4 posts, 1 answers
  1. Niels
    Niels avatar
    4 posts
    Member since:
    Oct 2011

    Posted 06 Oct 2011 Link to this post

    Hi,

    In the Q1 version of the Docking control I used floating panels in nested docking controls. The panels were positioned relative to the docking control they were placed in. But in the Q2 version the panels are positioned relative to the silverlight control/window.
    So position (0,0) is in Q1 the topleft corner of the docking control, but position (0,0) in Q2 is the topleft corner of the window.
    Is there a way to fix this and position the panels relative to their parent?
    Is this a bug, or by design and do I have to find another way to deal with this?
    The following XAML snippet illustrates the problem:

    <Grid x:Name="LayoutRoot" Background="White">
            <telerik:RadDocking x:Name="radDocking1" Background="White" BorderThickness="0" BorderBrush="{x:Null}" Padding="0" Margin="0,0,0,0" Grid.Row="1" Grid.Column="0" >
                <telerik:RadDocking.DocumentHost>
                    <telerik:RadSplitContainer>
                        <telerik:RadPaneGroup Name="Root"  TabStripPlacement="Top">
                            <telerik:RadPane Name="pane_1" Title="Pane 1"  CanUserPin="False" CanUserClose="False" CanDockInDocumentHost="True" >
                                <telerik:RadPane.Content>
                                    <telerik:RadDocking AllowUnsafeMode="True" Background="White">
                                        <telerik:RadSplitContainer InitialPosition="FloatingOnly">
                                            <telerik:RadPaneGroup ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto">
                                                <telerik:RadDocumentPane Name="rdp_pane1" telerik:RadDocking.FloatingSize="300,500" telerik:RadDocking.FloatingLocation="0,0" Header="Floating pane 1" CanDockInDocumentHost="False" CanUserPin="False" CanUserClose="False" />
                                            </telerik:RadPaneGroup>
                                        </telerik:RadSplitContainer>
                                    </telerik:RadDocking>
                                </telerik:RadPane.Content>
                            </telerik:RadPane>
                            <telerik:RadPane Name="HistorischBodemBestand" Title="HistorischBodemBestand"  CanUserPin="False" CanUserClose="False" CanDockInDocumentHost="True" >
                                <telerik:RadPane.Content>
                                    <telerik:RadDocking AllowUnsafeMode="True" Background="White">
                                        <telerik:RadSplitContainer InitialPosition="FloatingOnly">
                                            <telerik:RadPaneGroup ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto">
                                                <telerik:RadDocumentPane Name="rdp_pane2" telerik:RadDocking.FloatingSize="200,200" telerik:RadDocking.FloatingLocation="0,0" Header="Floating pane 2" CanDockInDocumentHost="False" CanUserPin="False" CanUserClose="False" />
                                            </telerik:RadPaneGroup>
                                            <telerik:RadPaneGroup ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto">
                                                <telerik:RadDocumentPane Name="rdp_pane3" telerik:RadDocking.FloatingSize="300,300" telerik:RadDocking.FloatingLocation="200,0" Header="Floating pane 3" CanDockInDocumentHost="False" CanUserPin="False" CanUserClose="False" />
                                            </telerik:RadPaneGroup>
                                        </telerik:RadSplitContainer>
                                    </telerik:RadDocking>
                                </telerik:RadPane.Content>
                            </telerik:RadPane>
                        </telerik:RadPaneGroup>
                    </telerik:RadSplitContainer>
                </telerik:RadDocking.DocumentHost>
                <telerik:RadSplitContainer x:Name="topPane" InitialPosition="DockedTop">
                    <telerik:RadPaneGroup>
                        <telerik:RadDocumentPane />
                    </telerik:RadPaneGroup>
                </telerik:RadSplitContainer>
                <telerik:RadSplitContainer InitialPosition="FloatingDockable" telerik:RadDocking.FloatingSize="300,300" VerticalAlignment="Top" HorizontalAlignment="Right">
                    <telerik:RadPaneGroup>
                        <telerik:RadDocumentPane>
                            <Grid Width="300" Height="300" />
                        </telerik:RadDocumentPane>
                    </telerik:RadPaneGroup>
                </telerik:RadSplitContainer>
            </telerik:RadDocking>
        </Grid>

  2. Answer
    Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 07 Oct 2011 Link to this post

    Hello Niels,

    This behavior is by design - the coordinate system of the windows of the Docking control should be the same as the one of the Silverlight plugin. We apologize for the inconvenience caused.
    To overcome this problem you might hook-up the PaneStateChanged event, find the window and if its Left and Top properties are 0 you can set them to be the same as the position of their owning Docking control. To find the location of the Docking control in the coordinate system of the Silverlight plugin you might use the following code:

    var docking = pane.GetParentDocking();
    var dockPosition = docking.TransformToVisual(Application.Current.RootVisual).Transform(new Point(0, 0))

    Hope this helps.

    Kind regards,
    Miroslav Nedyalkov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
  4. Niels
    Niels avatar
    4 posts
    Member since:
    Oct 2011

    Posted 07 Oct 2011 Link to this post

    OK, thanks. So the problem is really that I use nested Docking controls? Because those nested Docking controls are no longer using the same coordinate system as the Silverlight plugin. I was able to correct the position for the panes with the given code.Since I already had created an extension of the RadDocumentPane I could reposition the pane in the OnStateChange method.

    Is there a reason this behavior was changed in the Q2 version?
  5. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 07 Oct 2011 Link to this post

    Hi Niels,

    We decided to replace the docking ToolWindows with the base class of the Radwindow control - WindowBase and as the Windows are using a common coordinate system by default we decided that this is the correct behavior for the Docking windows as well.

    Regards,
    Miroslav Nedyalkov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top