# Search

## Content

Combo provides in-built functionality to perform search on the entire combo box list. This topic discusses how to enable search in the Combo control.

## Search List

To perform search operation, you can use **FindString** method of the <span data-popup-content="This class is available in \u003ca href=\u0022/componentone/docs/win/online-list/\u0022\u003e.NET\u003c/a\u003e and \u003ca href=\u0022/componentone/docs/win/online-list/\u0022\u003e.NET Framework\u003c/a\u003e." data-popup-title="C1Combo" data-popup-theme="ui-tooltip-green qtip-green">C1Combo</span> class. The method has parameters that let you set the target string, starting index of the row, and much more. Besides this, you can use **FindStringExact** method of the **C1Combo** class to search for the exact match.

The following code snippet demonstrates how to search for a value using FindString method.

```csharp
var found = -1;            
//search in every column
for (int col = 0; col < c1Combo1.Columns.Count; col++)
{
     //search for the string
     found = c1Combo1.Find("search");
     //if found set the selected index
     if (found != -1)
     {
        c1Combo1.SelectedIndex = found;
        return;
     }
 }
```

## Search Mismatch

The Combo control facilitates end-users to enable search mismatch in the list by using **Mismatch** event of the C1Combo class. The Mismatch event is triggered whenever the user enters a value in the combo box that is not found in the combo list. Please note that the Mismatch event is only fired when the [LimitToList](/componentone/api/win/online-list/dotnet-api/C1.Win.List.10/C1.Win.List.C1Combo.LimitToList.html) property is set to **true.**

The following GIF shows how the Mismatch event is fired in the Combo control. In this example, the user entered "9" which is not found in the combo box.

![Search mismatch](https://cdn.mescius.io/document-site-files/images/1e4aa2c8-7f81-4e43-8ed4-f673f1e68381/images/searchmismatch.gif)

The following code demonstrates how to enable search mismatch in the Combo control by subscribing to the Mismatch event.

```csharp
private void C1Combo1_Mismatch(object sender, C1.Win.List.MismatchEventArgs e)
{
    //if NewEntry entered by the user is not empty or white space
    if (!string.IsNullOrEmpty(e.NewEntry) || !string.IsNullOrWhiteSpace(e.NewEntry))
    {
        //show the message box when Match Not found
        MessageBox.Show("Match Not found");
    }
}
```