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

LoadLayout => ArgumentOutOfRangeException

3 Answers 115 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Michel
Top achievements
Rank 1
Michel asked on 22 Nov 2012, 08:34 PM
Hi,

I have an exception when I load a layout containing a radpane as a user control. The exception is:

{System.ArgumentOutOfRangeException: L'argument spécifié n'était pas dans les limites de la plage de valeurs valides.
Nom du paramètre : elementTypeName
   à Telerik.Windows.Controls.Docking.DockingLayoutFactory.GetElementByTypeName(IGeneratedItemsFactory factory, String elementTypeName)
   à Telerik.Windows.Controls.Docking.DockingLayoutFactory.LoadPane(XmlReader reader)
   à Telerik.Windows.Controls.Docking.DockingLayoutFactory.LoadPaneGroup(XmlReader reader)
   à Telerik.Windows.Controls.Docking.DockingLayoutFactory.LoadSplitItem(XmlReader reader)
   à Telerik.Windows.Controls.Docking.DockingLayoutFactory.LoadSplitContainer(XmlReader reader)
   à Telerik.Windows.Controls.Docking.DockingLayoutFactory.LoadDocking(XmlReader reader)
   à Telerik.Windows.Controls.RadDocking.LoadLayout(Stream source, Boolean raiseEventsIfNoSerializationTag)
   à Telerik.Windows.Controls.RadDocking.LoadLayout(Stream source)
   à Env.Nc.App.MainPage.LoadLayoutFromString(String xml)
   à Env.Nc.App.MainPage.MainPage_Loaded(Object sender, RoutedEventArgs e)
   à MS.Internal.CoreInvokeHandler.InvokeEventHandler(UInt32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   à MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)}

Does the load layout support radpane as user control?

This my code :

MainPage.xaml

<UserControl x:Class="RadControlsSilverlightApp1.MainPage"
        xmlns:local="clr-namespace:RadControlsSilverlightApp1"
        mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
    <Grid x:Name="LayoutRoot">
 
        <telerik:RadDocking x:Name="radDocking" BorderBrush="{x:Null}"  BorderThickness="0" Padding="0" >
 
            <telerik:RadSplitContainer  Orientation="Horizontal" InitialPosition="DockedBottom">
                <telerik:RadPaneGroup>
                    <!--<telerik:RadPane Header="DonneesDescriptivesView">
                    </telerik:RadPane>-->
                    <local:DonneesDescriptivesView></local:DonneesDescriptivesView>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
 
        </telerik:RadDocking>
 
    </Grid>
</UserControl>

MainPage.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.IO;
using System.Text;
 
namespace RadControlsSilverlightApp1
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
 
            this.Loaded += new RoutedEventHandler(MainPage_Loaded);
        }
 
        void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            LoadLayoutFromString(SaveLayoutAsString());
        }
 
        private string SaveLayoutAsString()
        {
            MemoryStream stream = new MemoryStream();
            this.radDocking.SaveLayout(stream);
 
            stream.Seek(0, SeekOrigin.Begin);
 
            StreamReader reader = new StreamReader(stream);
            return reader.ReadToEnd();
        }
 
        private void LoadLayoutFromString(string xml)
        {
            using (Stream stream = new MemoryStream(Encoding.UTF8.GetBytes(xml)))
            {
                stream.Seek(0, SeekOrigin.Begin);
                this.radDocking.LoadLayout(stream);
            }
        }
 
    }
}


DonneesDescriptivesView.xaml

<telerik:RadPane x:Class="RadControlsSilverlightApp1.DonneesDescriptivesView"
        x:Name="Michel"
        Header="DonneesDescriptivesView">
    <Grid>
         
    </Grid>
</telerik:RadPane>


Bye !

3 Answers, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 27 Nov 2012, 03:20 PM
Hello Michel,

Currently custom elements can not be loaded using the save/load layout logic. We have it logged here in our Public Issue Tracking System. As a workaround you can either edit the XML or the class of the Pane in and make sure the Pane is saved as a RadPane in order to be recognized by the load logic. 
Hope this will help.

Greetings,
Georgi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Theo
Top achievements
Rank 1
answered on 14 Jun 2013, 01:07 PM
Can you post a link to the specific bug in the bugtracker, I am not able to find it, and i would like to upvote it.
0
Georgi
Telerik team
answered on 18 Jun 2013, 10:52 AM
Hello Theo,

The link for the PITS issue is http://www.telerik.com/support/pits.aspx#/public/silverlight/12105 .
You can also access it by going to http://www.telerik.com/support/pits.aspx#/main/Release=AllReleases/Product=silverlight and search for " Save custom elements with the correct names " (you may need IE).
Also if you have any other questions, please don't hesitate to write us.


Regards,
Georgi
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Docking
Asked by
Michel
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Theo
Top achievements
Rank 1
Share this question
or