GetFloatingLocation / GetFloatingSize help

2 posts, 0 answers
  1. Louis
    Louis avatar
    24 posts
    Member since:
    Oct 2010

    Posted 11 May 2011 Link to this post

    In a RadDocking implementation, I have a DocumentHost, to which I add some RadDocumentPane objects during runtime.

    The user can undock these document panes to create floating panes.  When they click a Save button, I am trying to get the properties of those document panes and store them off in a database.  I do NOT want to use the LoadSaveLayout system that RadDocking provides via tagging etc.

    So the user clicks Save, I iterate thru all the visible RadDocumentPane objects, and get properties:
     
    ...
    Point location = RadDocking.GetFloatingLocation(pane.ParentOfType<RadSplitContainer>());
    xwriter.WriteAttributeString("Top", location.Y.ToString(ifp));
    xwriter.WriteAttributeString("Left", location.X.ToString(ifp));
    Size size = RadDocking.GetFloatingSize(pane.ParentOfType<RadSplitContainer>());
    xwriter.WriteAttributeString("Width", size.Width.ToString(ifp));
    xwriter.WriteAttributeString("Height", size.Height.ToString(ifp));
    ...

    Location is always coming back as 0,0, and size is always coming back as 220x300, no matter where the user has dragged the floating document pane, and no matter how much they've resized it. 

    Help? :)

     

     

    <telerik:RadDocking HorizontalAlignment="Stretch" x:Name="radDocking1" VerticalAlignment="Stretch" Close="radDocking1_Close" PreviewShowCompass="radDocking1_PreviewShowCompass" PaneStateChange="radDocking1_PaneStateChange">
        <telerik:RadSplitContainer x:Name="toolsSplitContainer" InitialPosition="DockedLeft" Orientation="Vertical">
            <telerik:RadPaneGroup x:Name="radPaneGroup1">
                <telerik:RadPane x:Name="layoutsPane" Header="Layouts" CanFloat="False" CanUserClose="False" IsSelected="True">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <telerik:RadTreeView x:Name="layoutsTreeView" Margin="0" Grid.Row="1" IsEditable="True" ItemTemplateSelector="{StaticResource myCategoryLayoutDataTemplateSelector}" MouseLeftButtonDown="layoutsTreeView_MouseLeftButtonDown">
                        </telerik:RadTreeView>
                    </Grid>
                </telerik:RadPane>
            </telerik:RadPaneGroup>
            <telerik:RadPaneGroup x:Name="propertiesPaneGroup" SelectedIndex="-1">
                <telerik:RadPane x:Name="propertiesPane" Header="Properties" CanFloat="False" CanUserClose="False" HorizontalAlignment="Right" />
            </telerik:RadPaneGroup>
        </telerik:RadSplitContainer>
        <telerik:RadDocking.DocumentHost>
            <telerik:RadSplitContainer x:Name="mainSplitContainer">
                <telerik:RadPaneGroup x:Name="DocPane">
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
        </telerik:RadDocking.DocumentHost>
    </telerik:RadDocking>

     

  2. Louis
    Louis avatar
    24 posts
    Member since:
    Oct 2010

    Posted 11 May 2011 Link to this post

    I've resorted to getting the properties more directly, which seems to work:

    if (pane.GetVisualParent<ToolWindow>() != null)
    {
        xwriter.WriteAttributeString("Top", pane.GetVisualParent<ToolWindow>().VerticalOffset.ToString(ifp));
        xwriter.WriteAttributeString("Left", pane.GetVisualParent<ToolWindow>().HorizontalOffset.ToString(ifp));
    }
    if (pane.GetVisualParent<RadSplitContainer>() != null)
    {
        xwriter.WriteAttributeString("Width", pane.GetVisualParent<RadSplitContainer>().ActualWidth.ToString(ifp));
        xwriter.WriteAttributeString("Height", pane.GetVisualParent<RadSplitContainer>().ActualHeight.ToString(ifp));
    }
  3. DevCraft banner
Back to Top