ASP.NET AjaxControlToolkit change Combobox content dynamically per Ajax
- by Ulli
If I understand it right the new ACT ComboBox Control is Bound once to a given Datasource.
But the count of the records I want to bind is very large.
So I want to load the content of the ComboBox List via Ajax after the user typed in a few charachters.
So at page load the combobox list should be empty and if something is typed in the list is loaded with the typed text as search text.
I tried this:
<asp:ComboBox ID="cbxCompany" DropDownStyle="DropDownList" runat="server" AutoCompleteMode="Append" />
Protected Sub cbxCompany_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbxCompany.TextChanged
Dim dt As DataTable = GetCompanies(cbxCompany.Text)
cbxCompany.DataSource = dt
cbxCompany.DataTextField = "nameout"
cbxCompany.DataValueField = "cid"
cbxCompany.DataBind()
End Sub
GetCompanies is my method for getting data from the database, the parameters filters the select statement. But this doesn't work.
Is there a way to reload the combobox content per Ajax?