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.
Unfortunately, activation email could not send to your email. Please try again.

How to select an item in AutoComplete from code behind by using the key field?

Description

AutoComplete control value can be selected by using its key value from code behind. This enables you to select a unique item when there are multiple items with the same Text value.

Solution

To select the AutoComplete TextBox value from code behind by using its Key value, you can use the SelectValueByKey property. By passing the corresponding Key value in the SelectValueByKey property, the Value is selected in the AutoComplete TextBox accordingly.

ASPX

 

CodeBehind CS

 

Note: The SelectValueByKey property can also be set from the ASPX page.

Article ID: Published Date: Last Revised Date: Platform: Control: Product Version:
3509 01/27/2015 01/27/2015 ASP.NET Web Forms AutoComplete 12.4.0.24
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.