Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combobox change to update other fields

Status
Not open for further replies.

mwardle

Programmer
Feb 11, 2002
30
GB
I'm having great fun with using a combobox to update other fields. The combobox is bound to a main dataview via the SelectedValue, and the Datasource, DisplayMember and ValueMember are all set, apparently correctly.
The idea is that one of the values in the combobox is a default, 'unchosen' value. When a different value is chosen, one of the other fields in the main table is set to the current date and time.
However, it seems that merely changing the chosen option in the combobox does not update the underlying dataview until focus is switched to the other field. The SelectedValue changes but the field value does not.
If I add a line of code to update the Value of the Date field for the current row, it appears to refresh immediately all the row's bindings and restore the 'unchosen' value to the combobox. It does not allow selecting another value. If I change the combobox to a listbox with identical properties, I am able to see the new option being chosen when I hold the mouse button down, and immediately reset when I release it.
If I leave the field-updating line of code out, I am able to select from the combobox normally.

Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top