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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to populate the AutoCompleteTextBox in code behind.

Thread ID:





73832 May 21,2008 08:29 PM UTC May 22,2008 02:29 PM UTC ASP.NET Web Forms (Classic) 1
Tags: Tools
Andy Richard
Asked On May 21, 2008 08:29 PM UTC

I'm trying to populate the AutoCompleteTextBox in code behind. The data is coming from a Web service as a strongly-typed dataset. I notice a DataSourceID property, but not a DataSource property. Any ideas?

This is urgent!

Janagan [Syncfusion]
Replied On May 22, 2008 02:29 PM UTC

Hi Andy,

Thanks for your interest in Syncfusion products.

You can populate the autocomplete textbox with dataset in code behind by the ProvideChoiceListOnCallback as mentioned in the code below:

protected void AutoCompleteTextBox1_ProvideChoiceListOnCallback(object sender, Syncfusion.Web.UI.WebControls.Tools.ACUserChoiceListEventArgs e)
ArrayList List = new ArrayList();
string key = e.Key;
DataSet dataset = new DataSet();
string url = "Id.xml";
DataTable dataTable = new DataTable();
dataTable = dataset.Tables[0];
DataRow[] Matchrow = dataset.Tables[0].Select(" Id like '" + key + "%'");
foreach (DataRow row in Matchrow)
string Id = row[0].ToString();
e.ChoiceList = List;

Please refer the sample in the link below which illustrates the above:


Please try running the sample and let me know if this helps.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon