This is a migrated thread and some comments may be shown as answers.
LoadLayout error
8 Answers 102 Views
This is a migrated thread and some comments may be shown as answers.
Riccardo
Top achievements
Rank 1
Riccardo asked on 22 Oct 2009, 11:00 AM
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.

8 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 22 Oct 2009, 11:31 AM
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.
0
Riccardo
Top achievements
Rank 1
answered on 22 Oct 2009, 03:37 PM
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.
0
Miroslav Nedyalkov
Telerik team
answered on 22 Oct 2009, 04:00 PM
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.
0
Scott
Top achievements
Rank 1
answered on 16 Sep 2011, 09:22 PM
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.
0
Jason McNair
Top achievements
Rank 1
answered on 22 Sep 2011, 03:01 AM
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
0
Ivo
Telerik team
answered on 22 Sep 2011, 01:01 PM
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 >>

0
Scott
Top achievements
Rank 1
answered on 22 Sep 2011, 05:24 PM
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)
...
0
Ivo
Telerik team
answered on 26 Sep 2011, 08:42 AM
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 >>

Asked by
Riccardo
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Riccardo
Top achievements
Rank 1
Scott
Top achievements
Rank 1
Jason McNair
Top achievements
Rank 1
Ivo
Telerik team
Share this question
or