JaedenRuiner
Well-known member
- Joined
- Aug 13, 2007
- Messages
- 340
- Programming Experience
- 10+
I'm running over this one in my head, and keep trying different things but the logistics aren't quite coming clear, and the problem I think is a cool enigma to resolve.
I have ComboBox's that are bound to a BindingSource on the DataBindings to store their value into a DataSet/DataTable/Datarow. Pretty straightforward, while at the same time I have a BindingSource that provides the List Item values from a different related parent DataTable.
as one would expect:
Seemingly a simple correlation, that the DataBinding takes the value from the bind_BOL datasource and populates the selected value of the control, which then selects the appropriate Email_ID for that value from the Bind_Email binding source.
The complexity here is that the DataSource for the Bind_Email binding source is a Table that has a multi-column primary key, based on CustomerID and Num. So the "Num" column within the Bind_Email datasource is duplicated many times, and thus to get the "accurate" Email_ID value for the particular "Num" value of the current Bind_BOL record requires the additional value of the bind_Bol.Current("Customer") column.
Thus, I tried this:
The problem is when I change from a record with customer ID 100107 to one with a customer ID of 100137, the filter update of the BOLEmailCmb.DataSource affects the BOLEmailCmb.DataBinding(0).DataSource into thinking the values have been changed, and the dataset thus believes its values have been dirtied.
Is there a way to define a binding source to base it's display value list off of two values instead of just one?
How could I handle this situation so that when the Bind_BOL bindingsource's position is changed to view a different record, the BOLEmailCmb reflects this change based upon Both the current Bind_BOL("Customer") column and the Bind_BOL("Num") column, preserving (saving) the "Num" value as the selected "ValueMember" to store for the BOLEmailCmb.DataBinding.
Thanks
I have ComboBox's that are bound to a BindingSource on the DataBindings to store their value into a DataSet/DataTable/Datarow. Pretty straightforward, while at the same time I have a BindingSource that provides the List Item values from a different related parent DataTable.
as one would expect:
VB.NET:
BOLEmailrCmb.DataBindings.Add(New System.Windows.Forms.Binding("SelectedValue", Me.bind_BOL, "Num", True))
BOLEmailCmb.DataSource = Bind_Email
BOLEmailCmb.DisplayMember = "Email_ID"
BOLEmailCmb.ValueMember = "Num"
Seemingly a simple correlation, that the DataBinding takes the value from the bind_BOL datasource and populates the selected value of the control, which then selects the appropriate Email_ID for that value from the Bind_Email binding source.
The complexity here is that the DataSource for the Bind_Email binding source is a Table that has a multi-column primary key, based on CustomerID and Num. So the "Num" column within the Bind_Email datasource is duplicated many times, and thus to get the "accurate" Email_ID value for the particular "Num" value of the current Bind_BOL record requires the additional value of the bind_Bol.Current("Customer") column.
Thus, I tried this:
VB.NET:
sub bind_Bol_CurrentChanged()
BOLEmailCmb.DataSource.Filter = "Customer=" & bind_bol.Current.Row("Customer")
end sub
Is there a way to define a binding source to base it's display value list off of two values instead of just one?
How could I handle this situation so that when the Bind_BOL bindingsource's position is changed to view a different record, the BOLEmailCmb reflects this change based upon Both the current Bind_BOL("Customer") column and the Bind_BOL("Num") column, preserving (saving) the "Num" value as the selected "ValueMember" to store for the BOLEmailCmb.DataBinding.
Thanks
Last edited: