?
=?ISO-8859-1?Q?D=E9j=E0-vu?=
Hi everybody,
I have a configuration with popups, that look something like this:
CREATE TABLE TrafficSign(
ID NUMBER,
LocationInfo TEXT,
Quality_Day NUMBER,
Quality_Night NUMBER
...
)
CREATE TABLE QualityValues(
ID NUMBER,
Desc TEXT
)
The idea is that both Quality_XXX columns reference a row in the
QualityValues table. (which I would assume as a typical "popup/combobox" scenario)
Now my form shows the data of exactly one TrafficSign.
It contains two ComboBoxes: one for the Quality_Day, one for the Quality_Night.
My DataSet contains both tables "TrafficSign" and "QualityValues", the latter only once.
The ComboBoxes are bound to the DataSet by the following sequence:
public void BindPopup(ComboBox box,
string popupTab, string popupIDCol, string popupDescCol,
string dataTab, string dataCol)
{
box.DropDownStyle = ComboBoxStyle.DropDownList;
box.DataSource = globalDataSet.Tables[popupTab];
box.DisplayMember = popupDescCol;
box.ValueMember = popupIDCol;
box.DataBindings.Add("SelectedValue", globalDataSet.Tables[dataTab], dataCol);
box.SelectedIndexChanged += new EventHandler(DataChangedHandler)
}
The function BindPopup is called twice with different parameters.
public void FormLoadHandler(...)
{
...
BindPopup(visDay, "VisibilityValues", "ID", "Desc", "TrafficSign", "Visibility_Day");
BindPopup(visNight, "VisibilityValues", "ID", "Desc", "TrafficSign", "Visibility_Night");
...
}
Now the Problem:
When I change the value of one of the ComboBoxes lets say "visDay" the other changes
to the same value (which is also reflected in the data row later.
What I want (of course) is that both values will change individually.
What I don't really want is to duplicate the QualityValues table in the DataSet.
Is there another way (i.e. install different instances of CurrencyManagers in the data binding)
to achieve the desired behaviour?
Any ideas are very much appreciated!
Tilman
PS:
The project uses .NET CF 2.0.
For debugging purposes I also have a .NET project that runs the same app on the desktop.
The behavior shows up in both cases.
I have a configuration with popups, that look something like this:
CREATE TABLE TrafficSign(
ID NUMBER,
LocationInfo TEXT,
Quality_Day NUMBER,
Quality_Night NUMBER
...
)
CREATE TABLE QualityValues(
ID NUMBER,
Desc TEXT
)
The idea is that both Quality_XXX columns reference a row in the
QualityValues table. (which I would assume as a typical "popup/combobox" scenario)
Now my form shows the data of exactly one TrafficSign.
It contains two ComboBoxes: one for the Quality_Day, one for the Quality_Night.
My DataSet contains both tables "TrafficSign" and "QualityValues", the latter only once.
The ComboBoxes are bound to the DataSet by the following sequence:
public void BindPopup(ComboBox box,
string popupTab, string popupIDCol, string popupDescCol,
string dataTab, string dataCol)
{
box.DropDownStyle = ComboBoxStyle.DropDownList;
box.DataSource = globalDataSet.Tables[popupTab];
box.DisplayMember = popupDescCol;
box.ValueMember = popupIDCol;
box.DataBindings.Add("SelectedValue", globalDataSet.Tables[dataTab], dataCol);
box.SelectedIndexChanged += new EventHandler(DataChangedHandler)
}
The function BindPopup is called twice with different parameters.
public void FormLoadHandler(...)
{
...
BindPopup(visDay, "VisibilityValues", "ID", "Desc", "TrafficSign", "Visibility_Day");
BindPopup(visNight, "VisibilityValues", "ID", "Desc", "TrafficSign", "Visibility_Night");
...
}
Now the Problem:
When I change the value of one of the ComboBoxes lets say "visDay" the other changes
to the same value (which is also reflected in the data row later.
What I want (of course) is that both values will change individually.
What I don't really want is to duplicate the QualityValues table in the DataSet.
Is there another way (i.e. install different instances of CurrencyManagers in the data binding)
to achieve the desired behaviour?
Any ideas are very much appreciated!
Tilman
PS:
The project uses .NET CF 2.0.
For debugging purposes I also have a .NET project that runs the same app on the desktop.
The behavior shows up in both cases.