2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
Customizing Appearance on Rendering while using NodeCollectionChanged EventsSyncfusion Diagram supports customizing the appearance of the node using the NodeCollectionChanged events. Using the NodeCollectionChanged events the node can be customized. The below code shows how to customize the appearance of the node. [C#] // Registering NodeCollectionChanged Event diagram2.EventSink.NodeCollectionChanged += EventSink_NodeCollectionChanged; // Customizing the Appearance of the node void EventSink_NodeCollectionChanged(CollectionExEventArgs evtArgs) { if (evtArgs.Elements is NodeCollection || evtArgs.Element is Node) { if (evtArgs.Elements is NodeCollection) { NodeCollection NodeColl = (NodeCollection)evtArgs.Elements; foreach (Node N in NodeColl) { // Customizing Nodes Line Color and width N.LineStyle.LineColor = Color.Red; N.LineStyle.LineWidth = 2; } } else { Node Nod = (Node)evtArgs.Element; Nod.LineStyle.LineColor = Color.Red; Nod.LineStyle.LineWidth = 2; } } } [VB] ' Registering NodeCollectionChanged Event Private diagram2.EventSink.NodeCollectionChanged += AddressOf EventSink_NodeCollectionChanged ' Customizing the Appearance of the node Private Sub EventSink_NodeCollectionChanged(ByVal evtArgs As CollectionExEventArgs) If TypeOf evtArgs.Elements Is NodeCollection OrElse TypeOf evtArgs.Element Is Node Then If TypeOf evtArgs.Elements Is NodeCollection Then Dim NodeColl As NodeCollection = CType(evtArgs.Elements, NodeCollection) For Each N As Node In NodeColl ' Customizing Nodes Line Color and width N.LineStyle.LineColor = Color.Red N.LineStyle.LineWidth = 2 Next N Else Dim Nod As Node = CType(evtArgs.Element, Node) Nod.LineStyle.LineColor = Color.Red Nod.LineStyle.LineWidth = 2 End If End If End Sub
|
2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
This page will automatically be redirected to the sign-in page in 10 seconds.