LoadLayout error

9 posts, 0 answers
  1. Riccardo
    Riccardo avatar
    36 posts
    Member since:
    Apr 2009

    Posted 22 Oct 2009 Link to this post

    I create two routines to load and save layout from and to a Byte[] var.
    Save works good, but when I try to load appear this error:
    System.ArgumentOutOfRangeException occurred  
      Message="Argomento specificato non compreso nell'intervallo.\r\nNome parametro: elementTypeName" 
      StackTrace:  
           su Telerik.Windows.Controls.Docking.DockingLayoutFactory.GetElementByTypeName(String elementTypeName)  
      InnerException:   
     


    I check and in the Byte[] var there are the correct saved with the RadDocking.SaveLayout(stream).

    Thanks.
  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 22 Oct 2009 Link to this post

    Hi Riccardo,

    This part of Stack trace doesn't give use enough information about what the problem is. It says the the problem happens in the GetElementByTypeName method, but we couldn't say what the problem is. Could please provide a sample project that reproduces the problem, open a support ticket and send the project to us. This will help a lot.

    All the best,
    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.
  3. DevCraft banner
  4. Riccardo
    Riccardo avatar
    36 posts
    Member since:
    Apr 2009

    Posted 22 Oct 2009 Link to this post

    Like you may read here I use inherited objects call EsaDocking, EsaPaneGroup...
    So I check that SaveLayout() works great and create good xml.
    LoadLayout goes in error: I think it doesn't recognize that structure.

    This is my xaml.
    <UserControl  
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:esa="clr-namespace:Esasoftware.Framework.Silverlight.UI;assembly=Esasoftware.Framework.Silverlight.UI" 
        xmlns:rad="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Docking" 
        x:Class="TestVari.Page" 
        Width="640" Height="480">  
     
        <Grid x:Name="LayoutRoot1" Background="White" HorizontalAlignment="Right" Width="640">  
            <Grid.RowDefinitions> 
                <RowDefinition Height="*"/>  
                <RowDefinition Height="auto"/>  
            </Grid.RowDefinitions> 
     
            <!-- esempio con esa (inizio) --> 
            <esa:EsaDocking x:Name="Dock" HorizontalAlignment="Left" VerticalAlignment="Top">  
                <esa:EsaDocking.DocumentHost> 
                    <esa:EsaSplitContainer> 
                        <esa:EsaPaneGroup esa:EsaDocking.SerializationTag ="TestPG" x:Name="TestPG">  
                            <esa:EsaPane Header="Test1" esa:EsaDocking.SerializationTag ="Test1P" x:Name="Test1P">  
                                <Grid> 
                                    <Grid Margin="5">  
                                        <TextBlock Text="Test mio Test mio Test mio Test mio Test mio Test mio Test mio Test mio Test mio Test mio Test mio Test mio Test mio Test mio Test mio Test mio "></TextBlock> 
                                    </Grid> 
                                </Grid> 
                            </esa:EsaPane> 
     
                        </esa:EsaPaneGroup> 
                    </esa:EsaSplitContainer> 
                </esa:EsaDocking.DocumentHost> 
            </esa:EsaDocking> 
            <!-- esempio con esa (fine) --> 
              
            <Button x:Name="bottoneCarica" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" Content="Carica" Margin="104,8,0,0" Grid.Row="1" Click="bottoneCarica_Click"/>  
            <Button x:Name="bottoneSalva" HorizontalAlignment="Left" Margin="8,8,0,0" VerticalAlignment="Top" Width="75" Content="Salva" Grid.Row="1" Click="bottoneSalva_Click"/>  
     
        </Grid> 
    </UserControl> 


    Thanks.
  5. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 22 Oct 2009 Link to this post

    Hi Riccardo,

    The Docking control doesn't support inheriting RadSplitContainers, RadPaneGroups and RadPanes yet. What I mean is it cannot load the layout, because it doesn't know how to create instances of your classes. You should also notice that inheriting RadSplitContainers and RadPaneGroups doesn't make much sense, because they are created and destroyed automatically. If you need to inherit controls, you should put SerializationTag to their instances. This will force the Docking control to reuse the old instances and it won't crash when loading the layout.

    We are planning to include this new feature (allowing inheritance of the RadDocking classes), but I cannot give you any concrete time frame for that.

    Best wishes,
    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.
  6. Scott
    Scott avatar
    66 posts
    Member since:
    Nov 2009

    Posted 16 Sep 2011 Link to this post

    Can you inherit from RadPane and save/load the layout with the 2011 Q2 release? I'm having some trouble using my own class inherited from RadPane.
  7. Jason McNair
    Jason McNair avatar
    4 posts
    Member since:
    Mar 2010

    Posted 21 Sep 2011 Link to this post

    I'm also wondering if there should be current support for this in the current release.  There doesn't appear to be, because we're still seeing issues with it.  I tried setting the SerializationTag on all of the inherited classes, as instructed previously in this thread.  Though it did cause the initial exception to go away, it did not work because it wiped out all of the initial classes that were loaded (the entire layout).  Looks like it has been almost 2 years since the originally stated intend to allow inherited classes in save/load layout.  Can we still count on this coming at some point?

    -Jason
  8. Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 22 Sep 2011 Link to this post

    Hello,

    By design you should be able to inherit from RadPane. We've tested the save/load functionality with inherited RadPane and it actually threw an exception. You can track the status of this issue in our PITS here. We will do our best to fix this for the next internal build.

    Kind regards,
    Ivo
    the Telerik team

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

  9. Scott
    Scott avatar
    66 posts
    Member since:
    Nov 2009

    Posted 22 Sep 2011 Link to this post

    Ivo can you tell me if the error you are getting is the same as mine? I get the following stack trace on RadDocking.LoadLayout():
    {System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
    Parameter name: elementTypeName
       at Telerik.Windows.Controls.Docking.DockingLayoutFactory.GetElementByTypeName(String elementTypeName)
       at Telerik.Windows.Controls.Docking.DockingLayoutFactory.LoadPane(XmlReader reader)
       at Telerik.Windows.Controls.Docking.DockingLayoutFactory.LoadPaneGroup(XmlReader reader)
       at Telerik.Windows.Controls.Docking.DockingLayoutFactory.LoadSplitItem(XmlReader reader)
       at Telerik.Windows.Controls.Docking.DockingLayoutFactory.LoadSplitContainer(XmlReader reader)
       at Telerik.Windows.Controls.Docking.DockingLayoutFactory.LoadDocking(XmlReader reader)
       at Telerik.Windows.Controls.RadDocking.LoadLayout(Stream source, Boolean raiseEventsIfNoSerializationTag)
       at Telerik.Windows.Controls.RadDocking.LoadLayout(Stream source)
    ...
  10. Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 26 Sep 2011 Link to this post

    Hello Scott,

    Yes, it is the same exception.

    Greetings,
    Ivo
    the Telerik team

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

Back to Top
DevCraft banner