We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Serialize/Deserialize the ControlNode

In Diagram Control, we don’t have a support to serialize the hosted control in Syncfusion.Windows.Forms.Diagram.ControlNode when the hosted control is non-serialized control. However, we can customize the Diagram’s Syncfusion.Windows.Forms.Diagram.ControlNode class and override the SerializeNode() as well as DeserializeNode() methods to achieve the requirement. The overridden methods contain HashTable collection as a parameter and it is used to add the Hosted control’s needed objects (i.e. serializable objects alone) into that collection while serializing/deserializing the customized control node.

The following steps contains how to serializing/deserializing the hosted control if the hosted control is non-serializable object.

Step1:

The following code example shows creating the custom controlNode

[C#]

 

[VB]

 

Step 2:

While Deserializing, we need to initialize the hosted control and reassign the deserialized objects into the initialized control’s objects.

The following code example shows how to deserializing the hosted control’s objects and reassign to the hosted control.

[C#]

 

[VB]

 

Step 3:

While deserializing, we need to initialize the hosted control and reassign the serialized objects into the initialized hosted control.

The following code example shows how to deserializing the hosted control’s objects.

[C#]

 

[VB]

 

Sample:

Sample

Article ID: Published Date: Last Revised Date: Platform: Control:
8464 02/20/2018 02/20/2018 Windows Forms Diagram
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.