Is there a way to have the Search box selected when a window with RadGridView is initialized? I want the user to be able to search straight away, without having to first click on the search box to enter text.
2 Answers, 1 is accepted
0
Dinko | Tech Support Engineer
Telerik team
answered on 15 Oct 2018, 07:02 AM
Hi David,
To focus the search text box initially you can subscribe to the Loaded event of the RadGridView. In the event handler, you can get the TextBox (x:Name="PART_SearchAsYouTypeTextBox") using our ChildrenOfType<T>() extension method. Then you can call the Focus() method to focus the text box. Check the following code snippet.
var txtBox = (sender as RadGridView).ChildrenOfType<TextBox>().FirstOrDefault(x=>x.Name == "PART_SearchAsYouTypeTextBox");
if(txtBox!= null)
{
txtBox.Focus();
}
}
Regards,
Dinko
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.Learn More.