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. Image for the cookie policy date

How to read connecting nodes ?

Hi,

in syncfusion diagram - suppose if i have an "Object A" with a "connector  c" connected to "Object B" , can i read this , i want to create a chemical factory application, and they want an visual interface to do the same, they want drag drop feature and on which they can assign values and later when they execute the flow is should work in way say input control (has some values in properties) which is connected to a processing unit "object B" with a connector "object c" and had an output "object d". so is that possible with syncfusion to perform that task .

can i get to know about the object connected by a connector "A" --- "connector" ---> "B" ... can i read it like values of object A with business logic of connector B and then save the values to object C properties ??

Thanks in advance 
Hemant

3 Replies

NG Naganathan Ganesh Babu Syncfusion Team March 19, 2015 05:57 AM UTC

Hi Hemant,

Thanks for using Syncfusion product.

We suggest you to use connector’s “FromNode” and “ToNode” properties in order to get the source and target node’s values respectively and add the values to the custom node’s “PropertyBag”. Please refer the below code snippet and sample for your references.

Here is the code snippet:

[C#]

Syncfusion.Windows.Forms.Diagram.Ellipse ellipse = new Syncfusion.Windows.Forms.Diagram.Ellipse(10, 10, 100, 100);

ellipse.Name = "Ellipse";

Syncfusion.Windows.Forms.Diagram.Rectangle rect = new Syncfusion.Windows.Forms.Diagram.Rectangle(150, 150, 100, 100);

rect.Name = "Rectangle";

diagram1.Model.AppendChild(ellipse);

diagram1.Model.AppendChild(rect);

OrgLineConnector con = new OrgLineConnector(new PointF(0, 0), new PointF(100, 100));

ellipse.CentralPort.TryConnect(con.HeadEndPoint);

rect.CentralPort.TryConnect(con.TailEndPoint);

diagram1.Model.AppendChild(con);

Syncfusion.Windows.Forms.Diagram.Rectangle rect2 = new Syncfusion.Windows.Forms.Diagram.Rectangle(300, 300, 100, 100);

rect2.PropertyBag.Add("Rectangle", (con.FromNode as Node).Name);

rect2.PropertyBag.Add("Ellipse", (con.ToNode as Node).Name);

Here is the Sample:

Sample

Please let us know if any concern.

Regards,

Naganathan K G



AL Allen December 30, 2017 11:43 AM UTC

This question is a bit old. I have been asking exactly the same question. So far, I couldn't find a solution for passing physical values from source to target via the connector.  I have seen the sample code. It does connect two objects but doesn't show the flow of values from the ellipse to the rectangle via the connecting line

I wondered if the person asking this question has succeded in finding the solution

I would like to ask here if for instance I give a value of 10 to the ellipse, how can I pass that to the rectange value, as follows

elleipse (value=10) -----> connector (holding value=10) ----> ButtonClick -------> pass value=10 to Rectangle (i.e when a button is clicked, the value in the rectangle =10)

mathematically, ValueOfRectangle = ValueOfEllipse + deltaFunction (any operation I may include)
And the nature of the connector will determine how fast the value will be passed over to the Rectangle area

Any comment or suggestion will be appreciated 


NG Naganathan Ganesh Babu Syncfusion Team January 2, 2018 11:56 AM UTC

Hi Allen, 
 
Please confirm us whether your requirement is to find the connected nodes? If so, we suggest you to use below mentioned list of Node’s properties, 
 
1.      Edges – it used to find all connected objects. 
2.      EdgesEntering – it used to find the head end points of the connected objects alone.  
3.      EdgesLeaving - it used to find the tail end points of the connected objects alone.  
 
We have created a sample as per your requirement of passing value to connected objects. Please refer to the below sample and video. Also let us know if your requirement is achieved or not? 
 
Sample: 
 
 
Video: 
 
 
Regards, 
 
Naganathan K G 


Loader.
Live Chat Icon For mobile
Up arrow icon