views:

657

answers:

4

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?

A: 

hi did you ever find a solution for this?

I am trying to do the exact same thing and the TextChanged event does not seem to be fired.

any help on how to get round this, or an alternative free control would me highly appreciated

thanks in advance

paul

paul
No, I found no proper solution for my problem.But I discontinued evaluating the standard combobox control, but started to develop my own control based on a a textbox with an expanding div.But my solution isn't ready yet and will be very customized to my special needs.Sorry ...
Ulli
A: 

you need to set autopostback=true

wenisman
A: 

This has nothing to do with Ajax.

SoftwareGeek
A: 

The functionality you're describing could be done easily with the ACT AutoComplete. See examples at http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/AutoComplete/AutoComplete.aspx

aponzani