SaveLayout generates extra XML

2 posts, 0 answers
  1. Ryan
    Ryan avatar
    18 posts
    Member since:
    Oct 2010

    Posted 09 Nov 2011 Link to this post

    Hello,

    I'm working with the Docking framework, and saving/loading the layout. I've noticed that the XML generated by the SaveLayout seems to generate a lot of extra XML after the actual template. It looks like it's exporting snippets of the rest of the layout. Here's an example:

    <?xml version="1.0" encoding="utf-8"?>
    <RadDocking>
    <DocumentHost>
    <RadSplitContainer Orientation="Horizontal">
    <Items>
    <RadPaneGroup SerializationTag="SearchResultsPaneGroup" SelectedIndex="0">
    <Items>
    <RadPane SerializationTag="SearchResults" IsDockable="True" Title="Search Results" Header="Search Results" CanUserClose="False" />
    </Items>
    </RadPaneGroup>
    </Items>
    </RadSplitContainer>
    </DocumentHost>
    <SplitContainers>
    <RadSplitContainer Dock="DockedLeft" Width="240" Orientation="Horizontal">
    <Items>
    <RadPaneGroup RelativeWidth="300" RelativeHeight="200" SelectedIndex="-1">
    <Items>
    <RadPane SerializationTag="SearchWindow" IsPinned="False" IsDockable="False" Title="Search" Header="Search" CanUserClose="False" AutoHideWidth="236" AutoHideHeight="602" />
    </Items>
    </RadPaneGroup>
    </Items>
    </RadSplitContainer>
    <RadSplitContainer Dock="DockedRight" Width="240" Orientation="Horizontal">
    <Items>
    <RadPaneGroup RelativeWidth="500" RelativeHeight="200" SelectedIndex="0">
    <Items>
    <RadPane SerializationTag="Messages" IsDockable="True" Title="Messages" Header="Messages" CanUserClose="False" />
    </Items>
    </RadPaneGroup>
    </Items>
    </RadSplitContainer>
    </SplitContainers>
    </RadDocking>


    litContainers>
    </RadDocking>
    orizontal">
    <Items>
    <RadPaneGroup RelativeWidth="500" RelativeHeight="200" SelectedIndex="0">
    <Items>
    <RadPane SerializationTag="Messages" IsDockable="True" Title="Messages" Header="Messages" CanUserClose="False" />
    </Items>
    </RadPaneGroup>
    </Items>
    </RadSplitContainer>
    </SplitContainers>
    </RadDocking>
    AutoGenerated="True" SelectedIndex="0">
    <Items>
    <RadPane SerializationTag="SearchWindow" IsDockable="True" Title="Search" Header="Search" CanUserClose="False" />
    </Items>
    </RadPaneGroup>
    </Items>
    </RadSplitContainer>
    <RadSplitContainer Dock="DockedLeft" Width="240" Orientation="Horizontal">
    <Items>
    <RadPaneGroup RelativeWidth="300" RelativeHeight="200" SelectedIndex="-1">
    <Items />
    </RadPaneGroup>
    </Items>
    </RadSplitContainer>
    <RadSplitContainer Dock="DockedRight" Width="240" Orientation="Horizontal">
    <Items>
    <RadPaneGroup RelativeWidth="500" RelativeHeight="200" SelectedIndex="0">
    <Items>
    <RadPane SerializationTag="Messages" IsDockable="True" Title="Messages" Header="Messages" CanUserClose="False" />
    </Items>
    </RadPaneGroup>
    </Items>
    </RadSplitContainer>
    </SplitContainers>
    </RadDocking>

    The second half of that (after "litContainers>) is not proper XML, and seems to be a few random portions of the first half. Is this intentional?

    I do note that this XML is loaded correctly by the LoadLayout Method, but it keeps the output from being read by any XML parser.

    Thanks,

    Ryan Brown
  2. Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 11 Nov 2011 Link to this post

    Hi Ryan,

    I would suggest you use FileMode.Create instead of FileMode.OpenOrCreate into the SaveLayout() method.

    Best wishes,
    Ivo
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
Back to Top