G
Guest
Hi
I have a form with multi-tabs, and on each tab I have a one combo that has
the same values.
I populate all 3 combo with the same one datacall/dataset
My problem is: when I make a value selection change to one, it changes the
other 2 combos on the other 2 tabs.
Is there a way to make one datacall, but have three seperate acting controls?
At the moment I have to call the same data call three time.
//Code Example
DataSet selectDataSet = DataCalls.RetrieveTypeOfFood();
DataSet menuDataSet = DataCalls.RetrieveTypeOfFood();
DataSet newDataSet = DataCalls.RetrieveTypeOfFood();
//*************************************
DataView dv = new DataView();
DataRow dr;
dr = selectDataSet.Tables[0].NewRow();
dr["Code"] = " - Select Type - ";
dr["CodeID"] = 0;
selectDataSet.Tables[0].Rows.Add(dr);
dv.Table = selectDataSet.Tables[0];
dv.Sort = "Code ASC";
SelectTypeComboBox.DisplayMember = "Code";
SelectTypeComboBox.ValueMember = "CodeID";
SelectTypeComboBox.DataSource = dv;
//**************************************
DataView mdv = new DataView();
DataRow mdr;
mdr = menuDataSet.Tables[0].NewRow();
mdr["Code"] = " - Select Type - ";
mdr["CodeID"] = 0;
menuDataSet.Tables[0].Rows.Add(mdr);
mdv.Table = menuDataSet.Tables[0];
mdv.Sort = "Code ASC";
MenuTypeComboBox.DisplayMember = "Code";
MenuTypeComboBox.ValueMember = "CodeID";
MenuTypeComboBox.DataSource = mdv;
//**************************************
DataView ndv = new DataView();
DataRow ndr;
ndr = newDataSet.Tables[0].NewRow();
ndr["Code"] = " - Select Type - ";
ndr["CodeID"] = 0;
newDataSet.Tables[0].Rows.Add(ndr);
ndv.Table = newDataSet.Tables[0];
ndv.Sort = "Code ASC";
NewTypesComboBox.DisplayMember = "Code";
NewTypesComboBox.ValueMember = "CodeID";
NewTypesComboBox.DataSource = ndv;
Thanks
Brian
I have a form with multi-tabs, and on each tab I have a one combo that has
the same values.
I populate all 3 combo with the same one datacall/dataset
My problem is: when I make a value selection change to one, it changes the
other 2 combos on the other 2 tabs.
Is there a way to make one datacall, but have three seperate acting controls?
At the moment I have to call the same data call three time.
//Code Example
DataSet selectDataSet = DataCalls.RetrieveTypeOfFood();
DataSet menuDataSet = DataCalls.RetrieveTypeOfFood();
DataSet newDataSet = DataCalls.RetrieveTypeOfFood();
//*************************************
DataView dv = new DataView();
DataRow dr;
dr = selectDataSet.Tables[0].NewRow();
dr["Code"] = " - Select Type - ";
dr["CodeID"] = 0;
selectDataSet.Tables[0].Rows.Add(dr);
dv.Table = selectDataSet.Tables[0];
dv.Sort = "Code ASC";
SelectTypeComboBox.DisplayMember = "Code";
SelectTypeComboBox.ValueMember = "CodeID";
SelectTypeComboBox.DataSource = dv;
//**************************************
DataView mdv = new DataView();
DataRow mdr;
mdr = menuDataSet.Tables[0].NewRow();
mdr["Code"] = " - Select Type - ";
mdr["CodeID"] = 0;
menuDataSet.Tables[0].Rows.Add(mdr);
mdv.Table = menuDataSet.Tables[0];
mdv.Sort = "Code ASC";
MenuTypeComboBox.DisplayMember = "Code";
MenuTypeComboBox.ValueMember = "CodeID";
MenuTypeComboBox.DataSource = mdv;
//**************************************
DataView ndv = new DataView();
DataRow ndr;
ndr = newDataSet.Tables[0].NewRow();
ndr["Code"] = " - Select Type - ";
ndr["CodeID"] = 0;
newDataSet.Tables[0].Rows.Add(ndr);
ndv.Table = newDataSet.Tables[0];
ndv.Sort = "Code ASC";
NewTypesComboBox.DisplayMember = "Code";
NewTypesComboBox.ValueMember = "CodeID";
NewTypesComboBox.DataSource = ndv;
Thanks
Brian