Skip to content

Commit fb22e53

Browse files
Merge pull request #2 from SweathaBharathi/patch-1
Update README.md
2 parents f882a5c + ee168f8 commit fb22e53

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,27 @@
22

33
## Search TreeNodeAdv based on its tag value
44

5-
In **TreeViewAdv**, you can filter **TreeNodeAdv** based on its Tag value. The following code example demonstrates the same.
5+
In [WinForms TreeViewAdv](https://www.syncfusion.com/winforms-ui-controls/treeview), you can search TreeNodeAdv based on its Tag value. The following code example demonstrates the same.
66

77
**C# Code Snippet:**
88

99
```C#
1010
List<TreeNodeAdv> nodes;
11-
//To search all nodes
11+
// To search all nodes
1212
nodes = treeViewAdv1.SearchTree().Where(n => n.Tag == "Search node").ToList();
13+
1314
public static class SOExtension
1415
{
1516
public static IEnumerable<TreeNodeAdv> SearchTree(this TreeViewAdv treeView)
1617
{
1718
return SearchTree(treeView.Nodes);
1819
}
20+
1921
public static IEnumerable<TreeNodeAdv> SearchTree(this TreeNodeAdvCollection coll)
2022
{
2123
return coll.Cast<TreeNodeAdv>().Concat(coll.Cast<TreeNodeAdv>().SelectMany(x => SearchTree(x.Nodes)));
2224
}
2325
}
24-
2526
```
2627

2728
**VB Code Snippet:**
@@ -30,11 +31,13 @@ public static class SOExtension
3031
Private nodes As List(Of TreeNodeAdv)
3132
'To search all nodes
3233
nodes = treeViewAdv1.FlattenTree().Where(Function(n) n.Tag = "Search node").ToList()
34+
3335
Public Module SOExtension
3436
<System.Runtime.CompilerServices.Extension()> _
3537
Public Function SearchTree(ByVal treeView As TreeViewAdv) As IEnumerable(Of TreeNodeAdv)
3638
Return SearchTree(treeView.Nodes)
3739
End Function
40+
3841
<System.Runtime.CompilerServices.Extension()> _
3942
Public Function SearchTree(ByVal coll As TreeNodeAdvCollection) As IEnumerable(Of TreeNodeAdv)
4043
Return coll.Cast(Of TreeNodeAdv)().Concat(coll.Cast(Of TreeNodeAdv)().SelectMany(Function(x) SearchTree(x.Nodes)))
@@ -46,4 +49,3 @@ End Module
4649
The following screenshot illustrates the search TreeNodeAdv by using its Tag value.
4750

4851
![Search TreeNodeAdv by using its tag value](Searchbytagvalue.png)
49-

0 commit comments

Comments
 (0)