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

RadLayoutControl Save/Load not working

1 Answer 125 Views
LayoutControl
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Iron
Iron
Iron
Thomas asked on 01 Aug 2017, 01:01 PM

Hello,

 

I'm using Telerik 2016.3.1024.45

I figure out how to save the layout with your documentation and I have now the xml of the layout

But when I tried to use LoadFromXmlString with the xml it did nothing and the layout stays empty

 

So I thought that my xml wasn't good and I took the one from your example and it didn't work either.

 

Here the xml I tried to load (it's your sample)

<?xml version="1.0" encoding="utf-8"?>
<RadLayoutControl Type="Telerik.Windows.Controls.RadLayoutControl" Width="NaN" Height="NaN" MinWidth="0" MinHeight="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" SerializationId="myLayoutControlID" Orientation="Horizontal" IsAutoGenerated="false" IsInEditMode="false">
  <Items>
    <Button Type="System.Windows.Controls.Button" Width="NaN" Height="NaN" MinWidth="0" MinHeight="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" SerializationId="buttonID_1" />
    <Border Type="System.Windows.Controls.Border" Width="NaN" Height="NaN" MinWidth="0" MinHeight="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" SerializationId="buttonID_2" />
    <LayoutControlGroup Type="Telerik.Windows.Controls.LayoutControlGroup" Width="NaN" Height="NaN" MinWidth="0" MinHeight="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" SerializationId="layoutGroup_1" Orientation="Vertical" IsAutoGenerated="false">
      <Items>
        <TextBlock Type="System.Windows.Controls.TextBlock" Width="NaN" Height="NaN" MinWidth="0" MinHeight="0" HorizontalAlignment="Stretch" VerticalAlignment="Center" SerializationId="txtBlock_1" />
        <LayoutControlGroup Type="Telerik.Windows.Controls.LayoutControlGroup" Width="NaN" Height="NaN" MinWidth="0" MinHeight="0" HorizontalAlignment="Stretch" VerticalAlignment="Center" SerializationId="layoutGroup_2" Orientation="Vertical" IsAutoGenerated="false">
          <Items>
            <TextBlock Type="System.Windows.Controls.TextBlock" Width="NaN" Height="NaN" MinWidth="0" MinHeight="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" SerializationId="txtBlock_2" />
          </Items>
        </LayoutControlGroup>
      </Items>
    </LayoutControlGroup>
  </Items>
</RadLayoutControl>

 

And I use this to load the xml :

LayoutControl.LoadFromXmlString(@"<xml_here>");

 

Can you help me please ?

 

Thank You

Hervouet Thomas

1 Answer, 1 is accepted

Sort by
0
Thomas
Top achievements
Rank 1
Iron
Iron
Iron
answered on 01 Aug 2017, 01:22 PM

Hello,

I understand my problem

I was using a generated GUID to use as SerializationId for both subelement and the LayoutControl

But when we load the xml the layoutcontrol loading the data need to have the same Id as in the xml or it will not find it

 

Thank you, it's working now

Hervouet Thomas

Tags
LayoutControl
Asked by
Thomas
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Thomas
Top achievements
Rank 1
Iron
Iron
Iron
Share this question
or