Search as You Type

Showing the Search Panel

Searching over XML data source is available as of R2 2018.

In case highlighting in a custom column or CellTemplate is needed, the HightlightTextBlock can be used. As of R3 2018 its constructor needs to have the SearchStateManager passed as a parameter. It is exposed through the SearchStateManager property of RadGridView. The usage of the HighlightTextBlock is demonstrated in the Custom Highlight Column.

As of R1 2016, RadGridView supports searching. Through the new boolean ShowSearchPanel property of the control, the user can show/hide the search panel. Its default value is False. If hidden, the search panel can be shown with the Ctrl+F shortcut.

The default searching behavior has two ways of setting the operator of the filtering criteria, depending on the value type of the property over which the search is performed. For a string type the operator is set to Contains. For all other types the operator is set to IsEqualTo.

Example 1: Showing the Search Panel

<telerik:RadGridView ItemsSource="{Binding Orders}"      
                         Name="orderItemsDataGrid" Margin="5"  
Figure 1: Showing the Search Panel

Showing the Search Panel

Disable showing the Search Panel

You can control whether the users can use the Search Panel through the CanUserSearch boolean property of RadGridView. Its default value is true. Setting it to false would permanently disable the functionality, meaning that the Ctrl + F combination would not show the panel as well.

Example 2: Disabling the Search Panel

<telerik:RadGridView ItemsSource="{Binding Orders}"      
                         Name="orderItemsDataGrid" Margin="5"  

Deferred Searching

The deferred searching functionality can be controlled through the IsSearchingDeferred property. Its default value is False and it determines whether the filtering through the search text box will be performed dynamically.

When IsSearchingDeferred is set to True, the filtering will be executed when the value is being committed on lost focus or when the Enter or Tab key is pressed.

Example 3: Setting the IsSearchingDeferred to True

<telerik:RadGridView ItemsSource="{Binding Orders}" 


Three new commands have been exposed for the text search functionality.

  • Search: Executed in order to show the search panel.

  • SearchByText: Executed in order to perform an actual search. It takes a string as a parameter - the text to search by.

  • CloseSearchPanel: Executed in order to hide the search panel.


As of R2 2016, the SearchPanelVisibilityChanged event will be raised on changing the ShowSearchPanel property. Its arguments are of type VisibilityChangedEventArgs and contain the value of the new visibility - NewVisibility.

A common scenario where you can use this event is when you want to clear the search criteria on collapsing the panel:

Example 4: Clearing search criteria on SearchPanelVisibilityChanged

public MainWindow() 
    this.RadGridView.SearchPanelVisibilityChanged += RadGridView_SearchPanelVisibilityChanged; 
void RadGridView_SearchPanelVisibilityChanged(object sender, VisibilityChangedEventArgs e) 
    if (e.NewVisibility == Visibility.Collapsed) 
        var clearSearchValue = GridViewSearchPanelCommands.ClearSearchValue as RoutedUICommand; 
        clearSearchValue.Execute(null, this.RadGridView.ChildrenOfType<GridViewSearchPanel>().FirstOrDefault()); 
Public Sub New() 
    AddHandler Me.RadGridView.SearchPanelVisibilityChanged, AddressOf RadGridView_SearchPanelVisibilityChanged 
End Sub 
Private Sub RadGridView_SearchPanelVisibilityChanged(sender As Object, e As VisibilityChangedEventArgs) 
    If e.NewVisibility = Visibility.Collapsed Then 
        Dim clearSearchValue = TryCast(GridViewSearchPanelCommands.ClearSearchValue, RoutedUICommand) 
        clearSearchValue.Execute(Nothing, Me.RadGridView.ChildrenOfType(Of GridViewSearchPanel)().FirstOrDefault()) 
    End If 
End Sub 

Modifying the Searching Criteria

In order to modify the search behavior, you can benefit from the following three search operators:

  • +: The items that will pass the filtering operation will have to contain both the value before the operator and the one after it.

    Figure 2: Using the + search operator

    Using the + search operator

  • -: All items that will pass the filtering operation will have to contain the value before the operator, but not the one after it.

    Figure 3: Using the - search operator

    Using the - search operator

  • "": When a word or a phrase is put in quotes, the filtered objects will contain only the exact same value.

    Figure 4: Using the "" search operator

    Using the "" search operator

Change the Label Text of the Search Panel

By default, the value of the TextBlock appearing before the Search TextBox in the SearchPanel is "Full Text Search". It can be altered through the Localization mechanism of RadGridView. The resource key that needs to be modified is GridViewSearchPanelTopText. More information can be found in the Localization topic.

Add Search Criteria Programmatically

RadGridView's search mechanism supports defining a search criteria programmatically. This can be done through the SearchByText Command. More information can be found in the Commands Overview topic.

Search Over Dynamic Data

As of R2 2018 RadGridView provides full support for searching over dynamic data. This includes IDynamicMetaObjectProvider(DynamicObject and ExpandoObject), ICustomTypeProvider and ICustomTypeDescriptor implementations.

Search in Hidden Columns

RadGridView's text search mechanism supports searching in hidden columns. This behavior can be enabled by setting the CanUserSearchInHiddenColumns property of the RadGridView control to True.

This feature was first introduced with the non-official version 2017.3.1127 of R3 2017. Afterwards, it was included in R1 2018 official release of the Telerik UI for WPF suite.

Example 5: Setting CanUserSearchInHiddenColumns property in XAML

<telerik:RadGridView CanUserSearchInHiddenColumns="True"/> 
## See Also
In this article
Not finding the help you need? Improve this article