Focus the RadWatermakTextBox Element of RadMultiColumnComboBox
Environment
Product Version | 2024.1.312 |
Product | RadMultiColumnComboBox for WPF |
Description
How to focus the RadWatermakTextBox
element of the RadMultiColumnComboBox
control.
Solution
Subscribe to the Loaded
event of RadMultiColumnComboBox and utilize the FindChildByType method to retrive the RadWatermarkTextBox
element. Then, you can call its Focus
method.
Retrieve the RadWatermarkTextBox element on the Loaded event of RadMultiColumnComboBox
private void RadMultiColumnComboBox_Loaded(object sender, RoutedEventArgs e)
{
var mccb = (RadMultiColumnComboBox)sender;
var textBox = mccb.FindChildByType<RadWatermarkTextBox>();
if (textBox != null)
{
textBox.Focus();
}
}
You can cache the RadWatermarkTextBox instance in a field and invoke the Focus method when required.