The search box TextBox element used with the search-as-you-type feature is not focused when you press the Tab key. This happens because the search box is excluded from the tab order (IsTabStop=False).
Use the ChildrenOfType extension method to get the TextBox element and set its IsTabStop to True.
private void gridView_Loaded(object sender, RoutedEventArgs e)
{
var searchBox = this.gridView.ChildrenOfType<TextBox>().FirstOrDefault(x => x.Name == "PART_SearchAsYouTypeTextBox");
searchBox.IsTabStop = true;
}
Hi,
This behavior is expected due to the default design of the RadGridView control. It implements a custom tab navigation logic, which implies that the IsTabStop property of the GridViewSearchPanel defaults to false. The search box TextBox element has a TemplateBinding to its parent GridViewSearchPanel and therefore it also has IsTabStop="false", coming from the default implementation of the search panel. This implementation included setting the IsTabStop property to false in code-behind. Now, the setter for the IsTabStop property is in the default Style of the GridViewSearchPanel, which enables overriding the property through a custom Style.
To include the search box in the tab order, you can either use the ChildrenOfType extension method to get the TextBox element and set its IsTabStop property to true (like in the provided code snippet), or define a Style like the following:
<Style TargetType="telerik:GridViewSearchPanel">
<!-- Add BasedOn="{StaticResource GridViewSearchPanelStyle}" if you use the NoXaml version of the binaries. -->
<Setter Property="IsTabStop" Value="True"/>
<Setter Property="Focusable" Value="False"/> <!-- Needed to avoid the default dashed FocusVisual border of the panel. -->
</Style>
Note that you might also need to implement a custom logic (e.g. creating a custom keyboard command provider) to change the default tab order of the GridView - it is designed to focus its cells first.
Regards,
Vicky
Progress Telerik