Skip to content

Commit bcf8de3

Browse files
ES-975464 - Resolve the ReadMe file length issue in this sample repository
1 parent a11169d commit bcf8de3

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,27 @@
1-
# How-to-filter-the-node-based-on-the-node-ID-in-winforms-treeviewadv
2-
This session describes how to filter the node based on the nodeID in winforms treeviewadv.
1+
# How to filter the node based on the node ID in WinForms TreeViewAdv
2+
3+
This session describes how to filter the node based on the nodeID in [WinForms TreeViewAdv](https://www.syncfusion.com/winforms-ui-controls/treeview).
4+
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.
6+
7+
``` csharp
8+
for(int nodeId = 0; nodeId <= 10000; nodeId++)
9+
{
10+
//Custom node for ID propety
11+
CustomTreeNodeAdv customNode = new CustomTreeNodeAdv();
12+
customNode.ID = nodeId;
13+
customNode.Text = "Node" + nodeId.ToString();
14+
this.treeViewAdv1.Nodes.Add(customNode);
15+
}
16+
//Iterates the nodes in the TreeViewAdv
17+
foreach (CustomTreeNodeAdv item in this.treeViewAdv1.Nodes)
18+
{
19+
//Gets the TextBox value
20+
string textvalue = item.ID.ToString();
21+
if(this.integerTextBox1.Text == textvalue)
22+
{
23+
//Gets the node by its ID
24+
MessageBox.Show(item.Text);
25+
}
26+
}
27+
```

0 commit comments

Comments
 (0)