I'm having the exact same problem. I have a single static array of values
that I use to bind to multiple combo boxes' DataSource propery. At runtime,
changing the value of combo box changes them all. The underlying
SelectedValue of each box keeps the proper value... just the display changes.
The only way around it I've found so far is to create a seperate identical
array for each box, but this is less-than efficient solution, and in
IT'Slop's problem, creating multiple tables just to feed a combo box would be
even worse.
> Hi guy,
> I have problem with databing. I have:
[quoted text clipped - 9 lines]
>
> Thanks for all
Oops... posted too soon. Here are some fragments from my problem:
The array I'm using as my datasource:
static public ListEntry[] BankAcctType_ValueList =
{
new ListEntry(" ", "No Account Specified"),
new ListEntry("F", "Fed Routing Number (ABA)"),
new ListEntry("D", "DDA Account Number"),
new ListEntry("B", "Bank Identifier Code (BIC/SWIFT)"),
new ListEntry("C", "CHIPS Participant"),
new ListEntry("U", "CHIPS Identifier")
};
ListEntry is pretty basic:
public class ListEntry
{
private string strValue;
private string strText;
public ListEntry(string Value, string Text)
{
strValue = Value;
strText = Text;
}
static public string Lookup(string Value, Array List) {...}
public string Text {...}
public string Value {...}
}
My ComboBox bindings. Each box is the same, except for the SelectedValue,
which I route to appropriate properties:
cbxBBK_AcctType.DataSource =
WireTransfer.Message.BankAcctType_ValueList;
cbxBBK_AcctType.DisplayMember = "Text";
cbxBBK_AcctType.ValueMember = "Value";
cbxBBK_AcctType.DataBindings.Add("SelectedValue", bsWire,
"BBK_AcctType");
> Hi guy,
> I have problem with databing. I have:
[quoted text clipped - 9 lines]
>
> Thanks for all
theftum - 11 May 2006 15:03 GMT
I have experienced a similar issue but in my case I am using strongly typed
object collections. The issue can be got around by using a different Binding
Source for each control, for example:
bsMembers.DataSource = BL_MemberRootCollection.Singleton;
bsMembers2.DataSource = BL_MemberRootCollection.Singleton;
cmbOwner.DataSource = bsMembers;
cmbOwner.DisplayMember = "MemberName";
cmbOwner.ValueMember = "MemberId";
colMemberName.DataSource = bsMembers2;
colMemberName.DisplayMember = "MemberName";
colMemberName.ValueMember = "MemberID";
Previously both controls were using the same bindingsource.
> Oops... posted too soon. Here are some fragments from my problem:
>
[quoted text clipped - 50 lines]
> >
> > Thanks for all