We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

How to Select Text in Auto Complete like TextBox.SelectAll()

Hi,

In AutoComplete Control, After I selected the item in drop down list, I want to highlight the text of selected item. How can it be done? Please advise. Thanks.


5 Replies

IM Iniyen M A Syncfusion Team May 24, 2011 08:37 AM UTC

Hi Tun,

Thanks for your interest in Syncfusion product.

You can achieve your requirement by using the AutoComplete's DropDownClosed event. For more information i have included the code snippet as follows.

[Code Snippet]
this.autoComplete1.DropDownClosed += new Syncfusion.Windows.Forms.PopupClosedEventHandler(this.autoComplete1_DropDownClosed);
private void autoComplete1_DropDownClosed(object sender, Syncfusion.Windows.Forms.PopupClosedEventArgs e)
{
this.textBoxExt1.SelectAll();
}

Please let us know if you need further assistance.

Regards,
Iniyen M.A.




TN Tun Nwe Aung May 30, 2011 02:30 AM UTC

Hi,
Thanks for your reply. There is no DropDownClosed event in wpf AutoComplete control. Please advise.



DM Deenadhayalan M Syncfusion Team May 31, 2011 01:49 PM UTC

Hi Tun,

Thanks for your interest in Syncfusion product.

To highlight the text of selecteditem in Autocomplete control by using the AutoComplete's IsDropDownOpenChanged event. Please find the workaround sample under the following location for your reference.

"PART_EditableTextBox" is a Textbox name which is used in the style of Autocomplete control source.

Please let us know if you have any queries.

Thanks,
Deenadhayalan



99433_Autocomplete_2de928aa.zip


TN Tun Nwe Aung June 1, 2011 03:13 AM UTC

Thank you so much. It's working great.



DM Deenadhayalan M Syncfusion Team June 1, 2011 03:46 AM UTC

Hi Tun,

Thank you for the udpate.

Regards,
Deenadhayalan


Loader.
Live Chat Icon For mobile
Up arrow icon