# Search Nodes

Learn about the API used to seach nodes in TreeView control.

## Content



TreeView enables you to search for the nodes matching the specified string. To search for a node in TreeView, you can use [Search](/componentone/docs/win/online-treeview/) or [SearchAll](/componentone/docs/win/online-treeview/) method of [C1TreeView](/componentone/docs/win/online-treeview/) class. The **Search** method takes string as a value, searches for the nodes using depth-first search and returns the node containing the searched string. On the other hand, the **SearchAll** method allows searches and shows all nodes containing the specified string.

The following image shows the searched node containing “Chai” as input string.

![Searching Nodes](https://cdn.mescius.io/document-site-files/images/56bb69d1-e225-4d79-8965-f70a0e789043/images/searchingnodes.png)

To search for the nodes containing the string you input, use the following code. In this example, we have taken a text box where you can provide a string to be searched on a button click.

```csharp
private void Searchbutton_Click(object sender, EventArgs e)
{
      c1TreeView1.Search(textBox1.Text);
}
```