AutoCompleteStringCollection problem

  • Thread starter Thread starter jack
  • Start date Start date
J

jack

This code dosent display
data.Add("Csharp");
data.Add("C sharp");

couldnt find the reason why ..



AutoCompleteStringCollection data = new
AutoCompleteStringCollection();
data.Add("Csharp");
data.Add("CSharp");
data.Add("C#");
data.Add("C #");
data.Add("C sharp");
data.Add("C Sharp");
comboBox1.AutoCompleteSource =
AutoCompleteSource.CustomSource;
comboBox1.AutoCompleteMode =
AutoCompleteMode.SuggestAppend;
comboBox1.AutoCompleteCustomSource = data;



Please help

Thanks for helping me
 
AutoCompleteStringCollection work in Windows Form. If your combox box is a
System.Windows.Forms.ComboBox, then it won't display in an asp.net form.
Rather you need to use a System.Web.UI.WebControls.DropDownList which
doesn't support this kind of feature.

If this _is_ a winform question, then ur in the wrong newsgroup.

If you want this type of functionality, you'll need to turn to a 3rd party
control that either uses a javascript array or Ajax such as
http://weblogs.asp.net/mschwarz/archive/2005/11/11/430267.aspx


Karl
 
Back
Top