ComboBoxAutoComplete Does not show the drop down list

Hi,

I have a problem with ComboBoxAutoComplete.

I setup the element using the code below:


AutoCompleteStringCollection strcollection = new AutoCompleteStringCollection();
strcollection.Add("Test1");
strcollection.Add("Test2");
strcollection.Add("Test3");
strcollection.Add("Test4");
strcollection.Add("Item1");
strcollection.Add("Check4");
strcollection.Add("Test5");
strcollection.Add("Check6");

comboAutoComplete.AutoCompleteSource = AutoCompleteSource.CustomSource;
comboAutoComplete.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
comboAutoComplete.AutoCompleteCustomSource = strcollection;
comboAutoComplete.Items.Clear();

foreach (string str in strcollection)
{
comboAutoComplete.Items.Add(str);

}
comboAutoComplete.SelectedItem = comboAutoComplete.Items[0];
}


When I clicked on the drop-down button, the list was not shown properly. The drop-down list showed up and closed instantly. How do I fix this problem? Thank you.

1 Reply

AD Administrator Syncfusion Team June 12, 2009 10:03 AM UTC

Hi Natalia,

Thank you for using Syncfusion products.

In ComboBoxAutocomplete control , the combobox drop down is overridden for showing the autocomplete dropdown . So instead of adding items to the items collection, add items to the autocomplete control using its DataSource property.

The following code snippet illustrates this.

[C#]

comboAutoComplete.AutoCompleteControl.DataSource = strcollection;

Please find the sample below that demonstrates this.

http://files.syncfusion.com/support/Tools.Windows/7.2.0.20/56844/main.htm

Please followup the incident 56844 for further queries.

Regards,
Jaya


Loader.
Up arrow icon