SuggestAppend Combobox shows doesnt show duplicate names (if exists)

I have a combobox of Names. There can be person with similar name. Now if I set AutoCompleteMode Property of ComboBox to SuggestAppend and if there are two records with same name, the SuggestAppend DropDown list shows only the first value (name).

Actual List:

Notice two Ratan Tata names here

Suggest Append:

When I type R in comboBox, it shows only one value of RatanTata

So now I get two problems due to this.

Problem 1: As said, we see only one name in the SuggestAppend DropDownlist.

Problem 2: Depending on the selected item in combobox, other controls on the form (textbox, listbox, combobox) shows the respective data of that selected contact.

Now in the scenario of duplicate names, when I manually select the 2nd Ratan Tata name, I see the details of 2nd Ratan Tata in respective controls on the form. But as and when I move out of the combobox (using tab or mouse click on other control) the respective data in the other controls changes to the value of 1st Ratan Tata .

I hope I am clear in explanation. Thanks in advance.


I think you should use Suggest instead of using SuggestAppend. Below is an explanation from MSDN when to use Suggest and when SuggestAppend:

None: Disables the automatic completion feature for the ComboBox and TextBox controls.

Suggest : Displays the auxiliary drop-down list associated with the edit control. This drop-down is populated with one or more suggested completion strings.

Append: Appends the remainder of the most likely candidate string to the existing characters, highlighting the appended characters.

SuggestAppend : Applies both Suggest and Append options.

链接地址: http://www.djcxy.com/p/60900.html

上一篇: ComboBox.Text =空字符串,而不是实际显示的字符串

下一篇: SuggestAppend Combobox显示不显示重复的名称(如果存在)