From d9bbc75fab60d4e8057937edd39be815f95c6d0b Mon Sep 17 00:00:00 2001 From: SweathaBharathi <104504991+SweathaBharathi@users.noreply.github.com> Date: Wed, 3 Sep 2025 16:16:53 +0530 Subject: [PATCH 1/5] Update README.md --- README.md | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index d97bd4b..9006112 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ # How to search and retrieve the tree node based on its text in WinForms TreeViewAdv? -## Search and retrieve the TreeNodeAdv text +In [WinForms TreeViewAdv](https://www.syncfusion.com/winforms-ui-controls/treeview) has built-in support to search the **TreeNodeAdv** based on its text, by using the class named **TreeViewAdvFindReplaceDialog**. It can be done using the following categories: -**TreeViewAdv** has built-in support to search the **TreeNodeAdv** based on its text, by using the class named **TreeViewAdvFindReplaceDialog**. It can be done using the following categories: 1. TreeViewSearchOption 2. TreeViewSearchRange 3. TreeViewSearchNavigation ## TreeViewSearchOption This property specifies the Searching option in TreeViewAdv. + 1. MatchWholeText 2. MatchCase @@ -85,6 +85,7 @@ This option helps to specify whether the search can be performed in the above ca TreeViewSearchForm form; //To assign the TreeViewAdv to TreeViewSearchForm form = new TreeViewSearchForm(this.treeViewAdv1); + //To show the search dialog void treeViewAdv1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { @@ -109,31 +110,37 @@ public partial class TreeViewSearchForm : MetroForm //To assign the TreeViewAdv to TreeViewSearchForm dialog = new TreeViewAdvFindReplaceDialog(this.TreeView); } + //To get the TreeViewSearchNavigation void comboBox3_SelectedIndexChanged(object sender, EventArgs e) { dialog.TreeViewSearchNavigation = (TreeViewSearchNavigation)this.SearchRangeCombo.Items[this.comboBox3.Items.IndexOf(this.comboBox3.SelectedItem)]; } + //To get the TreeViewSearchRange private void SearchRangeCombo_SelectedIndexChanged(object sender, EventArgs e) { dialog.TreeViewSearchRange = (TreeViewSearchRange)this.SearchRangeCombo.Items[this.SearchRangeCombo.Items.IndexOf(this.SearchRangeCombo.SelectedItem)]; } + //To get the TreeViewSearchOption private void SearchOptionCombo_SelectedIndexChanged(object sender, EventArgs e) { dialog.TreeViewSearchOption = (TreeViewSearchOption)this.SearchOptionCombo.Items[this.SearchOptionCombo.Items.IndexOf(this.SearchOptionCombo.SelectedItem)]; } + //To Find TreeNodeAdv private void button1_Click(object sender, EventArgs e) { dialog.Find(this.findTextBox.Text); } + //To Find All the TreeNodeAdv private void button2_Click(object sender, EventArgs e) { dialog.FindAll(this.findTextBox.Text); } + //To Replace the TreeNodeAdv private void button3_Click(object sender, EventArgs e) { @@ -141,6 +148,7 @@ public partial class TreeViewSearchForm : MetroForm if(dialog.Find(this.findTextBox.Text)) dialog.Replace(this.replaceTextbox.Text); } + //To Replace All the TreeNodeAdv private void button4_Click(object sender, EventArgs e) { @@ -181,34 +189,41 @@ Partial Public Class TreeViewSearchForm 'To assign the TreeViewAdv to TreeViewSearchForm dialog = New TreeViewAdvFindReplaceDialog(Me.TreeView) End Sub - 'To get the TreeViewSearchNavigation + + 'To get the TreeViewSearchNavigation Private Sub comboBox3_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) dialog.TreeViewSearchNavigation = CType(Me.SearchRangeCombo.Items(Me.comboBox3.Items.IndexOf(Me.comboBox3.SelectedItem)), TreeViewSearchNavigation) End Sub - 'To get the TreeViewSearchRange + + 'To get the TreeViewSearchRange Private Sub SearchRangeCombo_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles SearchRangeCombo.SelectedIndexChanged dialog.TreeViewSearchRange = CType(Me.SearchRangeCombo.Items(Me.SearchRangeCombo.Items.IndexOf(Me.SearchRangeCombo.SelectedItem)), TreeViewSearchRange) End Sub - 'To get the TreeViewSearchOption + + 'To get the TreeViewSearchOption Private Sub SearchOptionCombo_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles SearchOptionCombo.SelectedIndexChanged dialog.TreeViewSearchOption = CType(Me.SearchOptionCombo.Items(Me.SearchOptionCombo.Items.IndexOf(Me.SearchOptionCombo.SelectedItem)), TreeViewSearchOption) End Sub - 'To Find TreeNodeAdv + + 'To Find TreeNodeAdv Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button1.Click dialog.Find(Me.findTextBox.Text) End Sub - 'To Find All the TreeNodeAdv + + 'To Find All the TreeNodeAdv Private Sub button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button2.Click dialog.FindAll(Me.findTextBox.Text) End Sub - 'To Replace the TreeNodeAdv + + 'To Replace the TreeNodeAdv Private Sub button3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button3.Click Me.TreeView.SelectedNodes.Clear() If dialog.Find(Me.findTextBox.Text) Then dialog.Replace(Me.replaceTextbox.Text) End If End Sub - 'To Replace All the TreeNodeAdv + + 'To Replace All the TreeNodeAdv Private Sub button4_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button4.Click Me.TreeView.SelectedNodes.Clear() If dialog.FindAll(Me.findTextBox.Text) Then From 58b11f61b2977e5316e12f61c9aeaeb79596f7b6 Mon Sep 17 00:00:00 2001 From: SweathaBharathi <104504991+SweathaBharathi@users.noreply.github.com> Date: Wed, 3 Sep 2025 16:21:11 +0530 Subject: [PATCH 2/5] Update README.md --- README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 9006112..0a64137 100644 --- a/README.md +++ b/README.md @@ -168,6 +168,7 @@ public partial class TreeViewSearchForm : MetroForm Private form As TreeViewSearchForm 'To assign the TreeViewAdv to TreeViewSearchForm form = New TreeViewSearchForm(Me.treeViewAdv1) + 'To show the search dialog Private Sub treeViewAdv1_PreviewKeyDown(ByVal sender As Object, ByVal e As PreviewKeyDownEventArgs) If e.Modifiers = Keys.Control AndAlso e.KeyValue = Keys.F Then @@ -182,6 +183,7 @@ Partial Public Class TreeViewSearchForm Private dialog As TreeViewAdvFindReplaceDialog = Nothing 'Initialize the TreeViewAdv Private TreeView As TreeViewAdv + 'To pass the TreeviewAdv argument to the form. Public Sub New(ByVal tree As TreeViewAdv) InitializeComponent() @@ -190,32 +192,32 @@ Partial Public Class TreeViewSearchForm dialog = New TreeViewAdvFindReplaceDialog(Me.TreeView) End Sub - 'To get the TreeViewSearchNavigation + 'To get the TreeViewSearchNavigation Private Sub comboBox3_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) dialog.TreeViewSearchNavigation = CType(Me.SearchRangeCombo.Items(Me.comboBox3.Items.IndexOf(Me.comboBox3.SelectedItem)), TreeViewSearchNavigation) End Sub - 'To get the TreeViewSearchRange + 'To get the TreeViewSearchRange Private Sub SearchRangeCombo_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles SearchRangeCombo.SelectedIndexChanged dialog.TreeViewSearchRange = CType(Me.SearchRangeCombo.Items(Me.SearchRangeCombo.Items.IndexOf(Me.SearchRangeCombo.SelectedItem)), TreeViewSearchRange) End Sub - 'To get the TreeViewSearchOption + 'To get the TreeViewSearchOption Private Sub SearchOptionCombo_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles SearchOptionCombo.SelectedIndexChanged dialog.TreeViewSearchOption = CType(Me.SearchOptionCombo.Items(Me.SearchOptionCombo.Items.IndexOf(Me.SearchOptionCombo.SelectedItem)), TreeViewSearchOption) End Sub - 'To Find TreeNodeAdv + 'To Find TreeNodeAdv Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button1.Click dialog.Find(Me.findTextBox.Text) End Sub - 'To Find All the TreeNodeAdv + 'To Find All the TreeNodeAdv Private Sub button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button2.Click dialog.FindAll(Me.findTextBox.Text) End Sub - 'To Replace the TreeNodeAdv + 'To Replace the TreeNodeAdv Private Sub button3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button3.Click Me.TreeView.SelectedNodes.Clear() If dialog.Find(Me.findTextBox.Text) Then @@ -223,7 +225,7 @@ Partial Public Class TreeViewSearchForm End If End Sub - 'To Replace All the TreeNodeAdv + 'To Replace All the TreeNodeAdv Private Sub button4_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button4.Click Me.TreeView.SelectedNodes.Clear() If dialog.FindAll(Me.findTextBox.Text) Then From 45e5445a7b03fe0fe19e39962b8164858f09fa2f Mon Sep 17 00:00:00 2001 From: SweathaBharathi <104504991+SweathaBharathi@users.noreply.github.com> Date: Wed, 3 Sep 2025 16:22:21 +0530 Subject: [PATCH 3/5] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0a64137..cbb47b5 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,8 @@ public partial class TreeViewSearchForm : MetroForm TreeViewAdvFindReplaceDialog dialog = null; //Initialize the TreeViewAdv private TreeViewAdv TreeView; - //To pass the TreeviewAdv argument to the form. + + //To pass the TreeviewAdv argument to the form. public TreeViewSearchForm(TreeViewAdv tree) { InitializeComponent(); From 0cc75f662616de51a3cba27a76146698d63cceae Mon Sep 17 00:00:00 2001 From: SweathaBharathi <104504991+SweathaBharathi@users.noreply.github.com> Date: Wed, 3 Sep 2025 16:23:37 +0530 Subject: [PATCH 4/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cbb47b5..c30968e 100644 --- a/README.md +++ b/README.md @@ -161,7 +161,7 @@ public partial class TreeViewSearchForm : MetroForm ``` -**VB Code snippet:** +**VB.Net Code snippet:** ```VB From 950314334a7572080c9835547c5867f78380c28c Mon Sep 17 00:00:00 2001 From: SweathaBharathi <104504991+SweathaBharathi@users.noreply.github.com> Date: Mon, 8 Sep 2025 20:06:04 +0530 Subject: [PATCH 5/5] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c30968e..33cb835 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ This option helps to specify whether the search needs to be performed from the t This option helps to specify whether the search can be performed in the above cases repeatedly. The following code example demonstrates the same. -**C# Code snippet:** +**C#:** ```C# //Initialize the TreeViewSearchForm @@ -161,7 +161,7 @@ public partial class TreeViewSearchForm : MetroForm ``` -**VB.Net Code snippet:** +**VB.Net:** ```VB