IntiallyShown="false"
onprovidechoicelistoncallback="AutoCompleteTextBox1_ProvideChoiceListOnCallback" >
The Autocomplete textbox can be binded to a SqlDataSource in the ProvideChoiceListOnCallback event of the AutocompleteTextbox. An ArrayList can be populated with autocomplete suggestions got from the returned DataView as a result of executing Select() method. The ArrayList can be used as a ChoiceList to populate the Autocomplete Suggestions. Kindly refer the code snippet below to achieve this.
[C#]
protected void AutoCompleteTextBox1_ProvideChoiceListOnCallback(object sender, Syncfusion.Web.UI.WebControls.Tools.ACUserChoiceListEventArgs e)
{
ArrayList userChoiceList = new ArrayList();
SqlDataSource SQLds = new SqlDataSource();
SQLds.ID = "SqlDataSource2";
SQLds.ConnectionString = ConfigurationManager.ConnectionStrings["HierarchyDataConnectionString"].ConnectionString;
SQLds.SelectCommand = "SELECT [Controls] FROM [AutoComplete]";
DataView dv = (DataView)SQLds.Select(DataSourceSelectArguments.Empty);
foreach (DataRow myRow in dv.Table.Rows)
{
userChoiceList.Add(myRow["Controls"].ToString());
}
e.ChoiceList = userChoiceList;
}
Also I have created a simple sample to test this and it can be downloaded from the link below.
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=sample-combo (2)-1332887567.zip
Kindly try the above sample and please let me know if you have any other queries.
Regards,
Ranjithkumar.