New to Telerik UI for WPF? Download free 30-day trial

Text Search Navigation

RadPanelBar allows you to navigate through its items by typing on the keyboard while the control is focused. This will search and select the corresponding item.

To enable the feature, set the IsTextSearchEnabled property to True.

To change the search mode that is used to match the results, set the TextSearchMode property. This allows you to set one of the following modes:

  • StartsWith: This is the default mode.
  • Contains
  • StartsWithCaseSensitive
  • ContainsCaseSensitive

You can also utilize the IsTextSearchCaseSensitive property of RadPanelBar in order to determine if the search is case sensitive.

Example 1: Setting up text search navigation

<telerik:RadPanelBar IsTextSearchEnabled="True" TextSearchMode="Contains" /> 
When binding the RadPanelBar's ItemsSource property to a collection of business objects, you should set the TextSearch.TextPath attached property in order to tell what property should be used for the text search.

Example 2: Setting TextPath

<telerik:RadPanelBar IsTextSearchEnabled="True" telerik:TextSearch.TextPath="MyProperty" /> 
In Example 2 MyProperty points to a property defined in the view model of the panelbar items. If the typed text matches the value of this property, the corresponding item will get selected.

To increase the time interval for typing before the text is reset, set the TextSearch.AutoCompleteTimeout static property.

Example 3: Setting search text reset timeout

public MyUserControl()  
{   
    Telerik.Windows.Controls.TextSearch.AutoCompleteTimeout = new TimeSpan(1500);  
    InitializeComponent(); 
}  
Note that this property is used in several other Telerik controls and setting it will affect them as well.

See Also

In this article