ASP.NET AjaxControlToolkit change Combobox content dynamically per Ajax
Posted
by Ulli
on Stack Overflow
See other posts from Stack Overflow
or by Ulli
Published on 2009-09-11T13:28:32Z
Indexed on
2010/03/22
22:11 UTC
Read the original article
Hit count: 325
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?
© Stack Overflow or respective owner