cannot add pane after loadlayout

7 posts, 1 answers
  1. Tamas
    Tamas avatar
    33 posts
    Member since:
    Jun 2010

    Posted 08 Oct 2010 Link to this post

    Hi,

    Saving and loading the layout works fine but I have noticed that I cannot add panes after I load a layout. The code below simply adds a floating pane to a RadPaneGroup which is declares statically in xaml:

                RadPane newpane = new RadPane() { CanUserClose = false };
                RadPaneGroup.AddItem(newpane, Telerik.Windows.Controls.Docking.DockPosition.Center);
                newpane.MakeFloatingDockable();

    This works fine until I load a layout. After that nothing seems to happen. What could be the problem?

    Many thanks and best regards,
    Tamás
  2. George
    Admin
    George avatar
    1332 posts

    Posted 13 Oct 2010 Link to this post

    Hello Tamas,

    Could you please set a SerializationTag to the RadPaneGroups. Let me know if this resolves your issue. Also, if you send us a sample project that reproduces the problem, it would be very helpful.

    I will be glad to assist you further.

    Greetings,
    George
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Tamas
    Tamas avatar
    33 posts
    Member since:
    Jun 2010

    Posted 14 Oct 2010 Link to this post

    Hi,

    I have added a line to set the SerializationTag:

    RadDocking.SetSerializationTag(newpane, System.Guid.NewGuid().ToString());

    However I still cannot add new panes after the successful loading of layout. I'll try to prepare a sample project soon.

    Thanks and best regards,
    Tamas
  5. George
    Admin
    George avatar
    1332 posts

    Posted 19 Oct 2010 Link to this post

    Hello Tamas,

    We will greatly appreciate a sample project of yours. It will definitely help us in further pinpointing and resolving the problem. 

    Looking forward for your reply.


    All the best,
    George
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Tamas
    Tamas avatar
    33 posts
    Member since:
    Jun 2010

    Posted 19 Oct 2010 Link to this post

    Hi George,

    Thanks for the follow up. I've made a simple project. The problem can be reproduced the following way:

    - if you press the add container button, you'll see that adding a floating panel is working fine by default
    - now dock the new floating panel somewhere
    - save the layout
    - add another container and dock it also
    - load the layout: the previous layout will be loaded successfully
    - now you cannot add containers anymore :(

    Unfortunately I cannot attach zip files (maybe I just overlook something), so here is the code:

    XAML:

    <UserControl x:Class="RadDockingAddContainerIssue.MainPage"
        mc:Ignorable="d"
        d:DesignHeight="300" d:DesignWidth="400">
     
        <Grid x:Name="LayoutRoot" Background="White">
            <Grid.RowDefinitions>
                <RowDefinition Height="30"/>
                <RowDefinition Height="30"/>
                <RowDefinition Height="30"/>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
            <Button Grid.Row="0" Content="Add container" Click="Button_Click" />
            <Button Grid.Row="1" Content="Save layout" Click="Button_Click_1" />
            <Button Grid.Row="2" Content="Load layout" Click="Button_Click_2" />
            <telerik:RadDocking  Grid.Row="3" Name="RadDocking" HasDocumentHost="False">
                <telerik:RadSplitContainer Name="RadSplitContainer" >
                    <telerik:RadPaneGroup Name="RadPaneGroup" >
     
                    </telerik:RadPaneGroup>
                </telerik:RadSplitContainer>
            </telerik:RadDocking>
        </Grid>
    </UserControl>


    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.IsolatedStorage;
    using Telerik.Windows.Controls;
    using System.IO;
     
    namespace RadDockingAddContainerIssue
    {
        public partial class MainPage : UserControl
        {
            public MainPage()
            {
                InitializeComponent();
                CreateContainers();
            }
         
     
            private void CreateContainers()
            {
                RadPane newpane;
     
                newpane = new RadPane() { CanUserClose = false }; RadDocking.SetSerializationTag(newpane, System.Guid.NewGuid().ToString());
                RadPaneGroup.AddItem(newpane, Telerik.Windows.Controls.Docking.DockPosition.Left);
                newpane = new RadPane() { CanUserClose = false }; RadDocking.SetSerializationTag(newpane, System.Guid.NewGuid().ToString());
                RadPaneGroup.AddItem(newpane, Telerik.Windows.Controls.Docking.DockPosition.Center);
                newpane = new RadPane() { CanUserClose = false }; RadDocking.SetSerializationTag(newpane, System.Guid.NewGuid().ToString());
                RadPaneGroup.AddItem(newpane, Telerik.Windows.Controls.Docking.DockPosition.Right);
            }
     
     
            public void SaveLayout()
            {
                string xml;
                // Save your layout for example in the isolated storage.
                using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication())
                {
                    using (var isoStream = storage.OpenFile("RadDocking_Layout.xml", FileMode.OpenOrCreate))
                    {
                        this.RadDocking.SaveLayout(isoStream);
    /*                    isoStream.Seek(0, SeekOrigin.Begin);
                        StreamReader reader = new StreamReader(isoStream);
                        xml = reader.ReadToEnd();*/
                    }
                }
            }
     
            public void LoadLayout()
            {
                // Load your layot from the isolated storage.
                using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication())
                {
                    using (var isoStream = storage.OpenFile("RadDocking_Layout.xml", FileMode.Open))
                    {
                        this.RadDocking.LoadLayout(isoStream);
                    }
                }
            }
     
            private void Button_Click(object sender, RoutedEventArgs e)
            {
                RadPane newpane = new RadPane() { CanUserClose = false };
                RadPaneGroup.AddItem(newpane, Telerik.Windows.Controls.Docking.DockPosition.Center);
                RadDocking.SetSerializationTag(newpane, System.Guid.NewGuid().ToString());
                newpane.MakeFloatingDockable();
            }
     
            private void Button_Click_1(object sender, RoutedEventArgs e)
            {
                SaveLayout();
            }
     
            private void Button_Click_2(object sender, RoutedEventArgs e)
            {
                LoadLayout();
            }
        }
     
    }


    Thanks and best regards,
    Tamas
  7. Answer
    George
    Admin
    George avatar
    1332 posts

    Posted 22 Oct 2010 Link to this post

    Hi Tamas,

    I would suggest you to set serialization tag to the RadPaneGroup as well. This will resolve your issue. For example:

    <telerik:RadPaneGroup Name="RadPaneGroup" telerik:RadDocking.SerializationTag="paneGroup">

    For more information about saving the layout, I would suggest you to refer to our online documentation - http://www.telerik.com/help/silverlight/raddocking-save-load-the-content-of-the-panes.html
    and http://www.telerik.com/help/silverlight/raddocking-features-save-load-layout.html

    I hope this helps.


    Regards,
    George
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. Tamas
    Tamas avatar
    33 posts
    Member since:
    Jun 2010

    Posted 22 Oct 2010 Link to this post

    Hi,

    Now it works perfectly.

    Many thanks and best regards,
    Tamas
Back to Top
DevCraft banner