Skip to content

Commit 600dff5

Browse files
Update README.md
1 parent bcf8de3 commit 600dff5

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

README.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# How to filter the node based on the node ID in WinForms TreeViewAdv
1+
# How to Filter the Node Based on the NodeID in WinForms TreeView?
22

3-
This session describes how to filter the node based on the nodeID in [WinForms TreeViewAdv](https://www.syncfusion.com/winforms-ui-controls/treeview).
3+
This sample describes how to filter the node based on the nodeID in [WinForms TreeView](https://www.syncfusion.com/winforms-ui-controls/treeview) (TreeViewAdv).
44

5-
In the `TreeViewAdv`, [TreeNodeAdv](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Tools.Windows~Syncfusion.Windows.Forms.Tools.TreeNodeAdv.html) can be filtered based on its value by performing the iteration process. The following code example demonstrates the same.
5+
In the `TreeViewAdv`, TreeNodeAdv can be filtered based on its value by performing the iteration process. The following code example demonstrates the same.
6+
7+
#### C#
68

79
``` csharp
810
for(int nodeId = 0; nodeId <= 10000; nodeId++)
@@ -24,4 +26,25 @@ foreach (CustomTreeNodeAdv item in this.treeViewAdv1.Nodes)
2426
MessageBox.Show(item.Text);
2527
}
2628
}
27-
```
29+
```
30+
31+
#### Vb
32+
33+
``` vb
34+
For nodeId As Integer = 0 To 10000
35+
'Custom node for ID propety
36+
Dim customNode As New CustomTreeNodeAdv()
37+
customNode.ID = nodeId
38+
customNode.Text = "Node" & nodeId.ToString()
39+
Me.treeViewAdv1.Nodes.Add(customNode)
40+
Next nodeId
41+
'Iterates the nodes in the TreeViewAdv
42+
For Each item As CustomTreeNodeAdv In Me.treeViewAdv1.Nodes
43+
'Gets the TextBox value
44+
Dim textvalue As String = item.ID.ToString()
45+
If Me.integerTextBox1.Text = textvalue Then
46+
'Gets the node by its ID
47+
MessageBox.Show(item.Text)
48+
End If
49+
Next item
50+
```

0 commit comments

Comments
 (0)