All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
Hi,
I want to connect two item on the diagram programmatically. I am not sure that the procedure is correct or not?
1) set a ID (name)
2) search diagram.Shap array and find two ID
3) make connection with source and target index based on ID <name> found in step 2
Thank you.
var source =
this
.radDiagram1.Shapes.Where(s => s.Name ==
"Source"
).FirstOrDefault();
var target =
"Target"
RadDiagramConnection polylineConnection =
new
RadDiagramConnection() { Name =
"connection1"
};
polylineConnection.Source = source;
polylineConnection.Target = target;
polylineConnection.ConnectionType = Telerik.Windows.Diagrams.Core.ConnectionType.Polyline;
radDiagram1.AddShape(polylineConnection);
Dear Hristo,
It works!