DataBinding: ComboBox.Text not updating when SelectedValue changes?
- by Rob
This is the relevant designer code for the ComboBox:
Me.ProbationComboBox.DataBindings.Add(New System.Windows.Forms.Binding("Enabled", Me.RegistrationBindingSource, "IsRegistered", True))
Me.ProbationComboBox.DataBindings.Add(New System.Windows.Forms.Binding("SelectedValue", Me.RegistrationBindingSource, "ProbationID", True))
Me.ProbationComboBox.DataSource = Me.ProbationBindingSource
Me.ProbationComboBox.DisplayMember = "probation"
Me.ProbationComboBox.ValueMember = "id"
The problem is that when I call RegistrationBindingSource.ResetCurrentItem(), the SelectedValue property is refreshed with the correct value from RegistrationBindingSource.ProbationID(). However, the Text property is not updated.
Until I can figure out the problem with my binding, I've been doing this as a fix:
Me.ProbationComboBox.Text = CType(CType(Me.ProbationBindingSource.Current, DataRowView).Row, RootNamespace.DataSet.probationRow).probation
Any ideas? Your assistance is appreciated!