Reputation: 498
I have a combobox where the SelectedValue on the combo is bound to a property on a business object.
Everything works fine, but the property that's bound to the SelectedValue on the combo only gets updated when the focus leaves the control. I understand that the property doesn't get updated until the control is validated (loses focus), but I need it to update the datasource as soon as the dropdown is closed.
I know I could probably leave focus from the control on the DropDownClosed event but I'd prefer something a little less kludgy.
What's the best way to immediately update my datasource when the dropdown is closed?
Upvotes: 0
Views: 4343
Reputation: 1166
The way I'd do it is to set (in the events) the OnUpdate of the combo box and put in the VB.net
Me.<business object>.Requery
Upvotes: 0
Reputation: 36
Set the DataSourceUpdateMode to OnPropertyChanged. Here is similar problem:
Upvotes: 2