I have a data-bound combobox on a Windows form. When I select an item, all of the other bound components update properly. However, the list of drop-down items changes so that the selected item is duplicated in the list. For example, here is the original list:
This is what the list looks like when I select an item:
The combobox is bound to a bindingsource that gets its data from a LINQ to SQL query. The Display Member is the SpecName, the Value Member is the SpecID and the Selected Value is the SpecID field in the bindingsource.
How can I correct this duplication behavior?
解决方案
When I encountered a similar situation, the cause was the combobox Databindings|Text property.
I could duplicate the behavior described when this property was set to the relevant binding source and display field.
Setting the property to None caused the behavior to cease.