)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to perform search through the nodes in WinForms MultiColumnTreeView?

Platform: WinForms |
Control: MultiColumnTreeView |
Published Date: December 22, 2017 |
Last Revised Date: January 7, 2020

Searching

In MultiColumnTreeView, we can perform searching through its nodes using the enum “TreeViewSeachOption”.

C#

//Search in MultiColumnTreeView
TreeViewSearchForm searchform;
this.multiColumnTreeView1.SelectionMode = Syncfusion.Windows.Forms.Tools.MultiColumnTreeView.TreeSelectionMode.MultiSelectAll;
searchform = new TreeViewSearchForm(this.multiColumnTreeView1);
 
private void multiColumnTreeView1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
   if (e.Modifiers == Keys.Control && e.KeyValue == (Char)Keys.F)
   {
     searchform = new TreeViewSearchForm(this.multiColumnTreeView1);
     searchform.ShowDialog();
   }
}
//Search option
TreeViewFindReplaceDialog dialog = null;
dialog = new TreeViewFindReplaceDialog(this.TreeView);
dialog.Find("india", Syncfusion.Windows.Forms.Tools.MultiColumnTreeView.TreeViewSearchOption.MatchWholeText, TreeViewSearchRange.TreeView);
this.button2.Click += new System.EventHandler(this.button2_Click);
this.button1.Click += new System.EventHandler(this.button1_Click);
//Find 
private void button1_Click(object sender, EventArgs e)
{
   dialog.Find(this.findTextBox.Text);
}
//Find All
private void button2_Click(object sender, EventArgs e)
{
   dialog.FindAll(this.findTextBox.Text);
}

 

VB

'Search in MultiColumnTreeView
Private searchform As TreeViewSearchForm
Me.multiColumnTreeView1.SelectionMode = Syncfusion.Windows.Forms.Tools.MultiColumnTreeView.TreeSelectionMode.MultiSelectAll
searchform = New TreeViewSearchForm(Me.multiColumnTreeView1)
  
Private Sub multiColumnTreeView1_PreviewKeyDown(ByVal sender As Object, ByVal e As PreviewKeyDownEventArgs) Handles multiColumnTreeView1.PreviewKeyDown
     If e.Modifiers = Keys.Control AndAlso e.KeyValue = CType(Keys.F, Char) Then
        searchform = New TreeViewSearchForm(Me.multiColumnTreeView1)
        searchform.ShowDialog()
     End If
 End Sub
'Search option
Private dialog As TreeViewFindReplaceDialog = Nothing
dialog = New TreeViewFindReplaceDialog(Me.TreeView)
dialog.Find("india", Syncfusion.Windows.Forms.Tools.MultiColumnTreeView.TreeViewSearchOption.MatchWholeText, TreeViewSearchRange.TreeView)
 AddHandler button2.Click, AddressOf button2_Click
 AddHandler button1.Click, AddressOf button1_Click
'Find 
 Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
    dialog.Find(Me.findTextBox.Text)
 End Sub
'Find All
 Private Sub button2_Click(ByVal sender As Object, ByVal e As EventArgs)
    dialog.FindAll(Me.findTextBox.Text)
 End Sub
 

 

Searching for the nodes in MultiColumnTreeView

Fig 1: Searching for the nodes in MultiColumnTreeView

Samples:

C#: How to perform search through the nodes in MultiColumnTreeView_C#?

VB: How to perform search through the nodes in MultiColumnTreeView_VB?

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon