I need to clear the selection out of a combobox when it loads. How do I do this?
Posted on 2006-11-03
I have a combobox that is bound to a datatable (in a relational database). There are 4 items in the tabel that it pulls the data from. When I load the form it comes up with the first item in the list. Unfortunately the item that is shown in the combobox when it loads or another item is saved to the database is duplicated in the combobox list. I still have 3 items in the combobox, but whatever was the last item in it when it was saved is duplicated. How do I stop this so it will always show all the different items listed and still be bound to the table I need? The only way I can get it to show the 4 different items is to unbind it from the related table. But then it won't update the table because of that. I don't want to enter the items in the items list property because then it would not show any other items. This list will change depending what is entered into it from another table.
Combobox A (actual) Combobox B (waht I need)
Item 1 Item 1
Item 2 Item 2
Item 3 Item 3
Item 1 Item 4