Hi Dupleix,
Thanks for using Syncfusion product.
You have to add Serialization constructor and Serialization state information to your custom symbol. Please add the following codes in your custom symbol to resolve your problem
[Serializable()]
public class MySymbol : Symbol
{
public MySymbol()
{
//Add your custom symbol code here
}
// Serialization constructor for symbols.
protected override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
}
// Called when deserialization is complete.
protected override void OnDeserialization(object sender)
{
base.OnDeserialization(sender);
// Get references to the child objects
this.outerRect = this.GetChildByName("Rectangle") as Syncfusion.Windows.Forms.Diagram.Rectangle;
this.innerEllipse = this.GetChildByName("Ellipse") as Ellipse;
}
I have attached my Custom Symbol file for your reference. Please refer to this MySymbol Class and Serialization constructor for symbols.
Also refer to our ScriptyClient sample (C:\Program Files\Syncfusion\Essential Studio\4.4.0.51\Web\diagram.web\Samples\2.0\ScriptyClient) for more details. In this sample when yiu click on the "Add Symbol" button, you can add a button to the DiagramWebControl.
I hope this will resolve your problem. Let me know if you have any questions.
Thanks,
Nagaraj
CustomSymbol.zip