Diagram does not save RenderTransform of RadDiagramShape

2 posts, 0 answers
  1. Yogendra
    Yogendra avatar
    17 posts
    Member since:
    Aug 2013

    Posted 05 Aug 2013 Link to this post


    I am creating Diagram using this code:-
    <telerik:RadDiagram x:Name="MyDiagram"  Grid.Row="1" IsConnectorsManipulationEnabled="False" IsEnabled="False" RectSelectionMode="Full" SelectionMode="Multiple" >
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FF12997A" Offset="0.017"/>
                <GradientStop Color="#FF93D61D" Offset="1"/>
                <GradientStop Color="#FF4425B0" Offset="0.209"/>
                <GradientStop Color="#FF5632CF" Offset="0.418"/>
                <GradientStop Color="#FF062780" Offset="0.582"/>
                <GradientStop Color="#FFB82424" Offset="0.728"/>
        <telerik:RadDiagramShape x:Name="ConditionShape"
            Geometry="{telerik:FlowChartShape ShapeType=PredefinedShape}"
            Position="203,119" AllowDrop="False" BorderBrush="#FF3BB800" BorderThickness="30,0" FlowDirection="RightToLeft" FontSize="23" FontStyle="Italic" Foreground="#FF13F0D2" GlidingStyle="Ellipse" Margin="2,-41,21,62" OpacityMask="#FFD12727" Padding="-67,4,4,4" RenderTransformOrigin="0,0.5" RotationAngle="15" Stroke="#FF232C8F" StrokeThickness="15" TabIndex="2147483645" TextOptions.TextFormattingMode="Display" UseDefaultConnectors="False" UseLayoutRounding="False" FontFamily="CordiaUPC" >
                <CompositeTransform SkewX="-55" SkewY="29" TranslateX="-48.557" TranslateY="-2.4E-05"/>
                <PlaneProjection RotationX="-22" RotationY="-137" RotationZ="-40"/>
                <BlurEffect Radius="1"/>
                    <GradientStop Color="#FFFFB356" Offset="1"/>
                    <GradientStop Color="#FFFFDEDE"/>
                    <GradientStop Color="#FF6BC740" Offset="0.5"/>

    I am saving diagram using this code:-
    Dim str As String = MyDiagram.Save().ToString
    Dim strC As String() = New String(1) {}
    strC(0) = str
    File.WriteAllText("C:\NewDiagram\Diagram.Txt", strC(0), System.Text.Encoding.UTF8)

    And Load using this code:-
    Dim str = File.ReadAllText("C:\NewDiagram\Diagram.Txt", System.Text.Encoding.UTF8)

    Diagram.Load method doesn't load RenderTransform of RadDiagramShape.

    Please suggest me something to solve this problem.

  2. Pavel R. Pavlov
    Pavel R. Pavlov avatar
    1237 posts

    Posted 08 Aug 2013 Link to this post

    Hello Yogendra,

    I am not sure that I fully understand your scenario. Can you please elaborate more on the transform that you need to save. Please have in mind that the RadDiagram.Save() method serialized only the basic properties for the RadDiagramShape and RadDiagramConnection (e.g. Background, Content, Position...) for full list of the properties that are serialized by default you can take a look at this article.

    Basically, if you need to save a rotate transform you can manually serialize the RotationAngle property of the RadDiagramShape. The RadDiagram uses rotate transform to apply the rotation angle defined in that property. Furthermore, in order to save a ScaleTransform you can serialize the Zoom property of the RadDiagram. The control performs a scale transform in order to set the zoom index. Please note that this property is of the RadDiagram. This is why you need to subscribe to the Serialized/Deserialize events of the RadDiagram instead of subscribing to the ShapeSerialized/ShapeDeserialized events.

    Please try the approach described in the referenced article and let us know if you have any other questions.

    Pavel R. Pavlov
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top