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

Raddiagram only connectors loading

2 Answers 131 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
JP
Top achievements
Rank 1
JP asked on 26 May 2020, 04:47 AM

Hi,

I'm able to save my diagram but the loading is not working. After loading, the connectors show but the containers and shapes were missing. It seems that there is some issue in the deserialization of my nodes as the items in the raddiagram were only the connectors. I followed this example below but my raddiagram doesnt seem to deserialize my nodes when loading.

    public override NodeViewModelBase DeserializeNode(IShape shape, Telerik.Windows.Diagrams.Core.SerializationInfo info) 
    { 
        var node = base.DeserializeNode(shape, info); 
        if (info["MyPosition"] != null) 
        { 
             var position = Utils.ToPoint(info["MyPosition"].ToString()); 
         node.Position = position.Value; 
        } 
        return node; 
    } 

 

 

2 Answers, 1 is accepted

Sort by
0
JP
Top achievements
Rank 1
answered on 26 May 2020, 05:03 AM
Also, I'm not sure whether it is because I have two types of nodes (container and shape) so when serializing and deserializing, I have one ContainerNodeViewModelBase<object> and  one NodeViewModelBase
0
Petar Mladenov
Telerik team
answered on 28 May 2020, 06:47 AM

Hi Jasmine,

Could you please confirm you use SerializableGraphSource class for populating the Diagram ? The following help article demonstrates the approach when dealing with databound diagram that needs to be serialized:

HowTo serialize a databound diagram

Save/Load is a two-step process. So after save, you can check the saved XML to ensure all shapes and connections are properly saved. Then you can use the Shape/ConnectionDeserialized events to check how the load process goes. Is there any chance you use types which inherit from RadDiagramShapeBase ? After load, you can check the Items/Shapes collections of the diagram and ensure the count is the expected one. If shapes are not visible, this might be a problem related to styles.

Regards,
Petar Mladenov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Diagram
Asked by
JP
Top achievements
Rank 1
Answers by
JP
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or