# Full Text Filter

## Content



Full-text filtering is the simplest way to filter the grid. You need to bind a text box to the FlexGrid’s [FullTextFilterBehavior](/componentone/api/winui/online-winui/dotnet-api/C1.WinUI.Grid/C1.WinUI.Grid.FullTextFilterBehavior.html) class to get instant filtering that can match exact case, partial text or whole words across all columns of the grid. This can be implemented using [MatchCase](/componentone/api/winui/online-winui/dotnet-api/C1.WinUI.Grid/C1.WinUI.Grid.FullTextFilterBehavior.MatchCase.html), [MatchNumbers](/componentone/api/winui/online-winui/dotnet-api/C1.WinUI.Grid/C1.WinUI.Grid.FullTextFilterBehavior.MatchNumbers.html) and [MatchWholeWord](/componentone/api/winui/online-winui/dotnet-api/C1.WinUI.Grid/C1.WinUI.Grid.FullTextFilterBehavior.MatchWholeWord.html) properties to give you more specific values. You can also use [HighlightColor](/componentone/api/winui/online-winui/dotnet-api/C1.WinUI.Grid/C1.WinUI.Grid.FullTextFilterBehavior.HighlightColor.html) property to set the highlight color to the filtered data. This feature helps in distinguishing the filtered data from other values in the grid.

This GIF below demonstrates a simple text box that lets you type the value you want to search in the grid along with different filters like 'Treat spaces as And operator' and 'Match numbers'. Here, when you type "mu" in the Filter text box, it filters the grid data to display all the values containing 'mu'.

![](https://cdn.mescius.io/document-site-files/images/2d49eac2-0942-4770-99ef-52b14e6815bd/images/flexgrid-fulltextfilter.gif)

The following code example demonstrates how to apply full text filtering with 'match numbers' and 'treat spaces as And operator' options in FlexGrid. This example uses the Customer class used in [Quick Start](/componentone/docs/winui/online-winui/winui-controls/flexgrid/flexgrid-quickstart) topic.

**XAML view**

For this example, you need to add the C1.WinUI.Input NuGet package to your application and add the following namespaces in XAML view before the code:

```xml
xmlns:input="using:C1.WinUI.Input"
xmlns:c1="using:C1.WinUI.Grid"
xmlns:i="using:Microsoft.Xaml.Interactivity"
```

```xml
<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition/>
    </Grid.RowDefinitions>
    <input:C1TextBox x:Name="filter" Margin="0,30,0,0" Placeholder="Enter text to filter"/>
    <StackPanel Orientation="Horizontal" Grid.Row="1">
        <CheckBox x:Name="matchCase" Content="Match case" Margin="4"/>
        <CheckBox x:Name="matchWholeWord" Content="Match whole word" Margin="4" />
        <CheckBox x:Name="treatSpacesAsAndOperator" Content="Treat Spaces As And Operator" Margin="4" />
        <CheckBox x:Name="matchNumbers" Content="Match Numbers" Margin="4"/>
    </StackPanel>
    <c1:FlexGrid x:Name="grid" IsReadOnly="True" Grid.Row="2">
        <i:Interaction.Behaviors>
            <c1:FullTextFilterBehavior FilterEntry="{Binding ElementName=filter}" 
                    MatchWholeWord="{Binding IsChecked, ElementName=matchWholeWord}" 
                    MatchCase="{Binding IsChecked, ElementName=matchCase}"
                    TreatSpacesAsAndOperator="{Binding IsChecked, ElementName=treatSpacesAsAndOperator}"
                    MatchNumbers="{Binding IsChecked, ElementName=matchNumbers}" />
        </i:Interaction.Behaviors>
    </c1:FlexGrid>
</Grid>
```

**Code view**

```csharp
var data = Customer.GetCustomerList(100);
grid.ItemsSource = data;
grid.MinColumnWidth = 85;
```