I have two tables, Requests and Status. The Requests table has a field called status; which maps to the ID field in my Status lookup table. My status table has ID and Status fields.
I am trying to populate the options on my combobox with the records in my Status table and also assign the selectedvalue of a combobox to the status field in my Requests table.
Under combobox tasks, I have 'Use Databound Items' checked,
My datasource is my Status table, ID is the value and Status is the display
Under Seletedvalue, I have my status field selected from my RequestsBindingSource.
When I run the application the combbox shows all the records from the Status table but does not have the status field from the Requests table as the selectedvalue.
What am I doing wrong?
Here is my designer code:
I am trying to populate the options on my combobox with the records in my Status table and also assign the selectedvalue of a combobox to the status field in my Requests table.
Under combobox tasks, I have 'Use Databound Items' checked,
My datasource is my Status table, ID is the value and Status is the display
Under Seletedvalue, I have my status field selected from my RequestsBindingSource.
When I run the application the combbox shows all the records from the Status table but does not have the status field from the Requests table as the selectedvalue.
What am I doing wrong?
Here is my designer code:
VB.NET:
Me.StatusComboBox.FormattingEnabled = True
Me.StatusComboBox.Location = New System.Drawing.Point(628, 52)
Me.StatusComboBox.Name = "StatusComboBox"
Me.StatusComboBox.Size = New System.Drawing.Size(169, 21)
Me.StatusComboBox.TabIndex = 42
Me.StatusComboBox.DataSource = Me.ActiveStatusBindingSource
Me.StatusComboBox.DisplayMember = "Status"
Me.StatusComboBox.ValueMember = "ID"
Me.StatusComboBox.DataBindings.Add(New System.Windows.Forms.Binding("SelectedValue", Me.RequestsBindingSource, "Status", True))