This is a migrated thread and some comments may be shown as answers.

Highlight Text in RadAutocompleteTextBox

2 Answers 43 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Ke
Top achievements
Rank 1
Ke asked on 13 Jan 2014, 05:10 PM
Hi There,
Is there a way to force select all text in a RadAutocompleteTextBox? I tried to set IsHighlighted = true but it didn't work.

Thanks,
Ke

2 Answers, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 16 Jan 2014, 01:18 PM
Hello Ke,

In order to select all the text you will need to get the TextBox which contains the text and call its SelectAll method. If you are doing this on button click, the handler should look like following:

private void Button_Click(object sender, RoutedEventArgs e)
{
    this.Auto.Focus();
    (this.Auto.ChildrenOfType<TextBox>().First() as TextBox).SelectAll();
}

Firstly you will need to focus the AutoCompleteBox to be able to select all the text.

Hope this helps.

Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Ke
Top achievements
Rank 1
answered on 24 Jan 2014, 04:18 PM
works like a charm! thanks a lot!
Tags
AutoCompleteBox
Asked by
Ke
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Ke
Top achievements
Rank 1
Share this question
or