RadDocking SaveLayout issue

5 posts, 0 answers
  1. Rutger Kars
    Rutger Kars avatar
    13 posts
    Member since:
    Oct 2007

    Posted 23 Apr 2013 Link to this post

    Hi,

    we've got an issue with the saving functionality of RadDocking.
    When I call the RadDocking.SaveLayout() function, it will create a xml like (this is a snippet from the whole file):
    <RadSplitContainer Dock="DockedTop" Orientation="Vertical">
        <Items>
            <RadPaneGroup RelativeWidth="100" RelativeHeight="100" SplitterChange="422,180833333333" SelectedIndex="0">
                <Items>
                    <RadPane SerializationTag="LineAppearancesPane" IsDockable="True" />
                </Items>
            </RadPaneGroup>
            <RadPaneGroup RelativeWidth="100" RelativeHeight="300" SplitterChange="554,5425" SelectedIndex="0">
                <Items>
                    <RadPane SerializationTag="CallControlWheelPane" IsDockable="True" Header="" CanFloat="False" />
                </Items>
            </RadPaneGroup>
        </Items>
    </RadSplitContainer>

    When I do a loadLayout based on this XML, one of our panes is completely hidden, it looks like it is out of the screen. However, when I change the SplitterChange to 422, it's working correctly again. So it looks like a problem with the huge number of digits within that SplitterChange.

    So far, this problem only occurs on the machine of a tester, I couldn't reproduce a savelayout which would give me such a strange splitterchange as well. However, when I load his settings on my machine, I've got the same issue, so it must be in the xml, and somewhere in the savelayout.

    We are running RadControls for WPF v.2013.1.220.40
    Is this a known issue, or a quick solution/workaround for it? I could read the xml string again and change all SplitterChange values to integers as a temporary workaround, but prefer a more robust solution ;)

    Thanks in advance,
    Rutger
  2. Rutger Kars
    Rutger Kars avatar
    13 posts
    Member since:
    Oct 2007

    Posted 23 Apr 2013 Link to this post

    In the meanwhile, I've created a helper function which will strip all digits in the SplitterChange attribute:

    private MemoryStream DigitSaveXmlStream(MemoryStream ms)
    {
      ms.Seek(0, SeekOrigin.Begin);
      StreamReader reader = new StreamReader(ms);
     
      XmlDocument doc = new XmlDocument();
      doc.LoadXml(reader.ReadToEnd());
      var nodes = doc.SelectNodes("RadDocking/SplitContainers/RadSplitContainer/Items/RadPaneGroup");
      foreach (XmlElement node in nodes)
      {
           XmlAttribute attr = node.GetAttributeNode("SplitterChange");
           if (attr != null)
           {
               double newValue = Convert.ToDouble(attr.Value);
               int value = Convert.ToInt32(newValue);
               attr.Value = value.ToString();
            }
      }
     
      MemoryStream msReturn = new MemoryStream();
      doc.Save(msReturn);
     
      return msReturn;
    }

    So, when saving the layout I call this function and now it's working. However it's still a workaround for a bug in the savelayout function
    MemoryStream ms = new MemoryStream();
    this.mainView.RadDocking.SaveLayout(ms);
    // workaround for Telerik bug on SaveLayout
    ms = DigitSaveXmlStream(ms);
     
    // do the regular stuff
  3. UI for WPF is Visual Studio 2017 Ready
  4. George
    Admin
    George avatar
    1332 posts

    Posted 26 Apr 2013 Link to this post

    Hello Rutger,

    Thank you for contacting us. We will need some time to investigate the cause of the problem and we will contact you with additional information. I hope this is acceptable for you.

    Regards,
    George
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  5. George
    Admin
    George avatar
    1332 posts

    Posted 01 May 2013 Link to this post

    Hi Rutger,

     
    We managed to reproduce the problem on our side and we logged the issue in our PITS here - http://www.telerik.com/support/pits.aspx#/public/wpf/14935 We will look into this issue in one of our further releases.

    Meanwhile, the workaround you mentioned seems fine until the issue is resolved. I am glad to update your telerik points as well.

    All the best,
    George
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. Rutger Kars
    Rutger Kars avatar
    13 posts
    Member since:
    Oct 2007

    Posted 01 May 2013 Link to this post

    Thanks for your reply! I will use my workaround for the time being
Back to Top
UI for WPF is Visual Studio 2017 Ready