The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I need to access nodes that are grouped together. The nodes I need to access are of various types. There is a background rectangle node, a bmp picture in the upper corner, and two text nodes. Think of it as an Org Chart object when all grouped together.
I'm able to cycle through the nodes in the diagram but I can only see my groups and lines.
How do I get access to my 'children'. This part works great.
Here is my construction process.
Private Sub tbAddContact_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tbAddContact.Click Dim X As Integer = 215 Dim Y As Integer = 50
Dim nodeGroup As Group = New Group() With nodeGroup .Name = "nodeGroupContact" .Tag = "nodeGroupContact" .DrawPorts = False .EnableCentralPort = True .PinPoint = New Point(X, Y) End With
Dim nodeShape As Syncfusion.Windows.Forms.Diagram.FilledPath = Nothing nodeShape = New Syncfusion.Windows.Forms.Diagram.RoundRect(0, 0, 200, 60, MeasureUnits.Pixel) With nodeShape .Tag = "nodeShapeContact" .Name = "nodeShapeContact" .ShadowStyle.Visible = True .ShadowStyle.OffsetX = 6 .ShadowStyle.OffsetY = 6 .LineStyle.LineColor = Color.SteelBlue .LineStyle.LineWidth = 2 .FillStyle.Color = Color.WhiteSmoke .EditStyle.AllowSelect = True .EnableCentralPort = True '.PinPoint = New Point(X - 100, Y) End With nodeGroup.AppendChild(nodeShape)
Dim nodeNameText As Syncfusion.Windows.Forms.Diagram.TextNode = Nothing nodeNameText = New Syncfusion.Windows.Forms.Diagram.TextNode("New Contact") With nodeNameText .Tag = "nodeNameTextContact" .Name = "nodeNameTextContact" .Size = New SizeF(200, 25) .FontStyle.Style = System.Drawing.FontStyle.Regular .FontStyle.Family = "Arial" .FontStyle.Size = 10 .HorizontalAlignment = StringAlignment.Center .LineStyle.LineColor = Color.Transparent .PinPoint = New Point(100, Y - 30) End With nodeGroup.AppendChild(nodeNameText)
Dim nodeTitleText As Syncfusion.Windows.Forms.Diagram.TextNode = Nothing nodeTitleText = New Syncfusion.Windows.Forms.Diagram.TextNode("Title") With nodeTitleText .Tag = "nodeTitleTextContact" .Name = "nodeTitleTextContact" .Size = New SizeF(200, 25) .FontStyle.Style = System.Drawing.FontStyle.Regular .FontStyle.Family = "Arial" .FontStyle.Size = 10 .HorizontalAlignment = StringAlignment.Center .LineStyle.LineColor = Color.Transparent .PinPoint = New Point(100, Y) End With nodeGroup.AppendChild(nodeTitleText)
Dim nodebmp As BitmapNode = New BitmapNode(CType(Me.pbContact.Image, Bitmap)) With nodebmp .Tag = "nodebmpContact" .Name = "nodebmpContact" .LineStyle.LineColor = Color.Transparent .PinPoint = New Point(X - 210, Y - 40) End With nodeGroup.AppendChild(nodebmp)
nodeGroup.AppendChild(nodeShape) nodeGroup.AppendChild(nodeNameText) nodeGroup.AppendChild(nodeTitleText) nodeGroup.AppendChild(nodebmp) Me.Diagram1.Model.AppendChild(nodeGroup) End Sub
My problem is then attempting to cycle through all of the diagram contacts that have been created and access the nodeNameText and nodeTitleText values.
This would be a piece of cake in the world of classic TreeView structures. Traversing hierarchial nodes in a tree is snap.
...and here is the process I use to cycle through the objects.
The next step is still - how do I get to my Text nodes within the groups?
Please help.
Dim originalNode As Node For Each originalNode In Me.Diagram1.Model.Nodes Case "nodeGroupContact" Dim NewNode As TreeNode = New TreeNode(originalNode.Tag) NewNode.Name = originalNode.Name NewNode.Tag = originalNode.Tag NewNode.Text = originalNode.Name NewNode.ImageIndex = 28 NewNode.SelectedImageIndex = 28 nodeOrgChartRoot.Nodes.Add(NewNode) 'IterateTreeNodesToPrint(originalNode, NewNode)