New to Telerik UI for WPF? Start a free 30-day trial
Setting focus to RadChat on load
Updated on Mar 17, 2026
Environment
| Product Version | 2019.1.220 |
| Product | RadChat for WPF |
Description
How to set focus to RadChat on load.
Solution
Access the RadWatermarkTextBox inside the RadChat, using the ChildrenOfType extension method and focus it. This can be achieved in the Loaded event of the control.
XAML
<telerik:RadChat x:Name="chat" Loaded="chat_Loaded" />
C#
private void chat_Loaded(object sender, RoutedEventArgs e)
{
var chat = sender as RadChat;
var watermarkTextBox = chat.ChildrenOfType<RadWatermarkTextBox>().FirstOrDefault(tb => tb.Name == "PART_InputBox");
watermarkTextBox.Focus();
}