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

GetFloatingLocation / GetFloatingSize help

1 Answer 37 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Louis
Top achievements
Rank 1
Louis asked on 11 May 2011, 11:46 PM
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>

 

1 Answer, 1 is accepted

Sort by
0
Louis
Top achievements
Rank 1
answered on 12 May 2011, 02:07 AM

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));
}
Tags
Docking
Asked by
Louis
Top achievements
Rank 1
Answers by
Louis
Top achievements
Rank 1
Share this question
or