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

RadDocking SaveLayout issue

4 Answers 111 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Rutger Kars
Top achievements
Rank 1
Rutger Kars asked on 23 Apr 2013, 08:45 AM
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

4 Answers, 1 is accepted

Sort by
0
Rutger Kars
Top achievements
Rank 1
answered on 23 Apr 2013, 12:33 PM
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
0
George
Telerik team
answered on 26 Apr 2013, 02:09 PM
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.

0
George
Telerik team
answered on 01 May 2013, 12:17 PM
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.

0
Rutger Kars
Top achievements
Rank 1
answered on 01 May 2013, 04:34 PM
Thanks for your reply! I will use my workaround for the time being
Tags
Docking
Asked by
Rutger Kars
Top achievements
Rank 1
Answers by
Rutger Kars
Top achievements
Rank 1
George
Telerik team
Share this question
or