Error when loading a layout in Docking with IsPinned and FloatingDockable

6 posts, 0 answers
  1. Ulrich
    Ulrich avatar
    10 posts
    Member since:
    Jul 2011

    Posted 14 Aug 2012 Link to this post

    Hello, 

    I get an error when I try to load a layout which is saved from the last application-session. In the samples-code below I have redruced the code.
    If I swap <RadSplitContainer InitialPosition="FloatingDockable"> before <RadSplitContainer Dock="DockedLeft"> is works fine. But our layoutfiles are generated by RadDocking.SaveLayout.

    Location: System.RuntimeMethodHandle._InvokeMethodFast
     
    Stack Trace:
       bei System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
       bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       bei System.Delegate.DynamicInvokeImpl(Object[] args)
       bei System.Windows.RoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       bei MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
     
    Inner Exception:
    1. InnerException.Message:
    System.InvalidOperationException: Element already has a logical parent. It must be detached from the old parent before it is attached to a new one.
       bei MS.Internal.Controls.InnerItemCollectionView.AssertPristineModelChild(Object item)
       bei MS.Internal.Controls.InnerItemCollectionView.Insert(Int32 index, Object item)
       bei System.Windows.Controls.ItemCollection.Insert(Int32 insertIndex, Object insertItem)
       bei Telerik.Windows.Controls.Docking.AutoHideArea.Add(RadPane pane, Boolean suppressAnimations)
       bei Telerik.Windows.Controls.Docking.AutoHideArea.UnpinPane(RadPane pane, Boolean suppressAnimations)
       bei Telerik.Windows.Controls.RadDocking.UnpinPane(RadPane radPane, AutoHideArea area, Boolean stopEvents)
       bei Telerik.Windows.Controls.RadDocking.OnRadPanePinChange(Object sender, PinChangeEventArgs args)


    Telerik WPF Version 2012.2.725.40

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="29" />
            <RowDefinition Height="1*" />
        </Grid.RowDefinitions>
        <Button Width="94" Content="load Layout" Click="Button_Click" />
        <telerikDocking:RadDocking x:Name="radDocking" Grid.Row="1" />
    </Grid>



    private void Button_Click(object sender, RoutedEventArgs e)
    {
        try
        {
            using (var fs = new FileStream("./Last_Layout.xml", FileMode.Open))
            {
                radDocking.LoadLayout(fs);
            }
        }
        catch (System.Exception ex)
        {
            System.Console.WriteLine("Error while loading lastlayout " + ex.Message);
        }
    }



    Last_Layout.xml 

    <?xml version="1.0" encoding="utf-8"?>
    <RadDocking>
      <DocumentHost>
        <RadSplitContainer>
          <Items>
            <RadPaneGroup SelectedIndex="-1">
              <Items />
            </RadPaneGroup>
          </Items>
        </RadSplitContainer>
      </DocumentHost>
      <SplitContainers>
        <RadSplitContainer Dock="DockedLeft" Width="240" RelativeWidth="100" RelativeHeight="100" IsAutoGenerated="True">
          <Items>
            <RadPaneGroup RelativeWidth="100" RelativeHeight="100" IsAutoGenerated="True" SelectedIndex="0">
              <Items>
                <RadPane SerializationTag="GKL.Module.PreisBildErhebung.ViewModule:BildExplorerView" IsPinned="False" IsDockable="False" AutoHideWidth="236" AutoHideHeight="994" />
              </Items>
            </RadPaneGroup>
          </Items>
        </RadSplitContainer>
     
        <RadSplitContainer InitialPosition="FloatingDockable" FloatingWidth="1722" FloatingHeight="1200" FloatingX="2024" FloatingY="0" FloatingWindowState="Normal" IsInOpenWindow="True" RelativeWidth="100" RelativeHeight="100" IsAutoGenerated="True">
          <Items>
     
     
          </Items>
        </RadSplitContainer>
      </SplitContainers>
    </RadDocking>
  2. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 20 Aug 2012 Link to this post

    Hello Ulrich,

    This issue is fixed in the latest internal build. Could you please download it and give it a try. The fix will be also available in the SP2 version, which will be released in the middle of September.

    All the best,
    Konstantina
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Ulrich
    Ulrich avatar
    10 posts
    Member since:
    Jul 2011

    Posted 23 Aug 2012 Link to this post


    Hello Konstantina,

    unfortunately the issue is still there in last internal build (2012.2.823.40) and need to handle in 
    Application_DispatcherUnhandledException.


    Last_Layout.xml 
    <?xml version="1.0" encoding="utf-8"?>
    <RadDocking>
      <DocumentHost>
        <RadSplitContainer>
          <Items>
            <RadPaneGroup SelectedIndex="-1">
              <Items />
            </RadPaneGroup>
          </Items>
        </RadSplitContainer>
      </DocumentHost>
      <SplitContainers>
        <RadSplitContainer Dock="DockedRight" Width="240" RelativeWidth="100" RelativeHeight="100" IsAutoGenerated="True">
          <Items>
            <RadPaneGroup RelativeWidth="100" RelativeHeight="100" IsAutoGenerated="True" SelectedIndex="-1">
              <Items>
                <RadPane SerializationTag="SerializationTag2" IsPinned="False" IsDockable="False" Header="RadPaneGroup3" AutoHideWidth="236" AutoHideHeight="273" />
              </Items>
            </RadPaneGroup>
          </Items>
        </RadSplitContainer>
        <RadSplitContainer InitialPosition="FloatingDockable" FloatingWidth="220" FloatingHeight="300" FloatingX="769" FloatingY="286" FloatingWindowState="Normal" IsInOpenWindow="True" RelativeWidth="100" RelativeHeight="100" IsAutoGenerated="True">
          <Items>
            <RadPaneGroup RelativeWidth="100" RelativeHeight="100" IsAutoGenerated="True" SelectedIndex="0">
              <Items>
                <RadPane SerializationTag="SerializationTag1" IsPinned="True" IsDockable="True" />
              </Items>
            </RadPaneGroup>
          </Items>
        </RadSplitContainer>
      </SplitContainers>
    </RadDocking>
  5. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 29 Aug 2012 Link to this post

    Hello,

    I have logged this issue in PITS. You could track its status here. We will do out best to provide a fix for the upcoming service pack, which due in the middle of September.
    Sorry for the caused inconvenience.

    Kind regards,
    Konstantina
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. Matthias
    Matthias avatar
    1 posts
    Member since:
    Aug 2012

    Posted 15 Nov 2012 Link to this post

    I can confirm this issue is not fixed in 2012 Q3. There's still a crash when saving a layout with an IsPinned pane. It's related to some reparenting issue within RadDocking/RadPane.
  7. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 20 Nov 2012 Link to this post

    Hello,

    I am sorry, but the fix didn't make it in the official release. It is now scheduled for the Q1 2013 version. You could track the status of the issue in PITS. When it gets fixed you will be notified and you could download the according internal build.

    All the best,
    Konstantina
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
UI for WPF is Visual Studio 2017 Ready