How to pass data in diagram

Does anyone know how to pass data in diagram with user interaction? For instance, the diagram has three rectangles; rect1, rect2, rect3.  At right-click, a custom form pops up to enter data for each rectangle. Let's say, the form associated to rect1 has a text field holding 10; and the form associated to rect2 has a text field holding 8.  Now, I connect rect1 to rect3; rect2 to rect3.  It is like, rect1+rect2 = rect3.  So, when I open a result form associated to rect3, it prints 18 (i.e 10+8).  When the diagram is saved, respective values have to be saved (and load them when the diagram opens).  I am trying to implement mathematical operations for a complex assignment. However, if this simple operation can be done, it can give hint to implement the complex task.

I would highly appreciate if anyone has ideas on how to implement.  

1 Reply

NG Naganathan Ganesh Babu Syncfusion Team December 20, 2017 06:49 AM UTC

Hi Allen, 
 
We suggest you to use Diagram.Node’s “PropertyBag” dictionary property to add/remove the values and it will automatically save/load the values while saving/loading the diagram. Please refer to the below code example and sample. 
 
Code example: 
 
[VB] 
 
Dim rect1 As New Syncfusion.Windows.Forms.Diagram.Rectangle(100, 50, 100, 50) 
rect1.PropertyBag.Add("value1", 10) 
  
Here is the sample: 
 
 
Regards, 
 
Naganathan K G 


Loader.
Up arrow icon