Hi
I try to create a few dynamic bound combobox controls, but as soon as i
select a value from one of the controls, all the other controls are change to
the value witch i've selected.
how can I make each combo ack by itself?
Thanks in advance
Y. Hergass
Ciaran O''Donnell - 30 Jan 2007 09:11 GMT
You need a binding source for each one. Each binding source only has one
current which the controls use.

Signature
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
> Hi
> I try to create a few dynamic bound combobox controls, but as soon as i
[quoted text clipped - 5 lines]
> Thanks in advance
> Y. Hergass
Larry Lard - 30 Jan 2007 10:21 GMT
> Hi
> I try to create a few dynamic bound combobox controls, but as soon as i
> select a value from one of the controls, all the other controls are change to
> the value witch i've selected.
>
> how can I make each combo ack by itself?
Instead of (say)
comboBox1.Datasource = myDatasource;
comboBox2.Datasource = myDatasource;
comboBox3.Datasource = myDatasource;
do
BindingSource bs1 = new BindingSource();
bs1.Datasource = myDatasource;
comboBox1.Datasource = bs1;
BindingSource bs2 = new BindingSource();
bs2.Datasource = myDatasource;
comboBox2.Datasource = bs2;
BindingSource bs3 = new BindingSource();
bs3.Datasource = myDatasource;
comboBox3.Datasource = bs3;

Signature
Larry Lard
larrylard@googlemail.com
The address is real, but unread - please reply to the group
For VB and C# questions - tell us which version
Hergass - 30 Jan 2007 15:20 GMT
Tank you for your help
I've Only added the .Copy to the DataTable:
for i = 1 to 10
dim DT as DataTable
DT=DS.Tables(TableName)
combo(i) = New ComboBox()
combo(i).Size = New Size(comboWidth, 21)
combo(i).Location = New Point(120, lineHeight * i + iTop)
combo(i).DataSource = DT.Copy
combo(i).ValueMember = "str"
combo(i).DisplayMember = "val"
combo(i).Name = tblName & "combo" & i.ToString
combo(i).Tag = i.ToString
grpBox.Controls.Add(combo(i))
next i
Thanks again
Hergass
> > Hi
> > I try to create a few dynamic bound combobox controls, but as soon as i
[quoted text clipped - 22 lines]
> bs3.Datasource = myDatasource;
> comboBox3.Datasource = bs3;
Tim Van Wassenhove - 30 Jan 2007 16:14 GMT
Hergass schreef:
> I try to create a few dynamic bound combobox controls, but as soon as i
> select a value from one of the controls, all the other controls are change to
> the value witch i've selected.
You need to lookup what a CurrencyManager is... And make sure all the
combobox bindings talk to a different one... (More info can be found at
eg: http://www.codeproject.com/vb/net/databindingconcepts.asp)

Signature
Tim Van Wassenhove <url:http://www.timvw.be/>