The one in datagrid.
The combo box outside the datagrid has selectedvalue to dataset, and one in the datagrid does not.
But they all has same value member and datasource.
Main Topics
Browse All TopicsI have one combo box in out in the field and the other one in datagrid. And they are both using same dataSource, displaymember, and value member.
Whenever I change something from either one, they both get effect.
How do I make each one individual so that they don't get effect by changes on the other?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Must they both be connected to the datasource? You could just redo one of the combobox to add each item from the datasource to the combobox's object collection...
ie
say datasource is a dataset...
dim drDataRow as DataRow
For each drDataRow in myDataSet.Table(0)
ComboBox1.Items.Add(drData
Next
''''''''''''''This is one inside the datagrid''''''''''''''''''
''''''Start''''''
Private Sub grdSynonyms_CurrentCellCha
If grdSynonyms.CurrentCell.Co
cmb_Sy_Species.Visible = True
cmb_Sy_Species.Width = 0
cmb_Sy_Species.Left = grdSynonyms.GetCurrentCell
cmb_Sy_Species.Top = grdSynonyms.GetCurrentCell
If (Not IsDBNull(grdSynonyms.Item(
cmb_Sy_Species.SelectedVal
Else
cmb_Sy_Species.TabIndex = 0
End If
Private Sub grdSynonyms_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles grdSynonyms.Click
If (Not IsDBNull(grdSynonyms.Item(
cmb_Sy_Species.SelectedVal
Else
cmb_Sy_Species.TabIndex = 0
End If
End If
Private Sub grdSynonyms_SelectedIndexC
If grdSynonyms.CurrentCell.Co
cmb_Sy_Species.Visible = False
grdSynonyms.Item(grdSynony
End If
''''End''''
''''''''''''''''''This is one in outside the datagrid''''''''''''''''''
'
'editSpecies
'
Me.editSpecies.DataBinding
Me.editSpecies.DataSource = Me.objdsAncillary.Species
Me.editSpecies.DisplayMemb
Me.editSpecies.Location = New System.Drawing.Point(128, 232)
Me.editSpecies.Name = "editSpecies"
Me.editSpecies.Size = New System.Drawing.Size(224, 21)
Me.editSpecies.TabIndex = 70
Me.editSpecies.ValueMember
It's difficult to tell what is wrong with the code... but I'd venture some guesses and ask a couple more questions!
"cmb_Sy_Species", on selected index change would change the "currentCell" of "grdSynonyms." Since you didn't give the entire sub procedure for "grdSynonyms" in the above pasted code, it might be possible that on currentCell change, you are also changing the selectedValue for "editSpecies.
On that, could you give the other handlers for "grdSynonyms", "editSpecies", and "grdSynonyms" please?
It looks like you are hiding cmb_sy_species on and off... and that the combobox is completely independent of the datagrid. Is it a combobox layered onto of the datagrid? If so, consider trying out the sample project I linked from the other topic you created.
HI, your problem is discussedhere: http://www.dotnet247.com/2
You can try giving one of your comboBoxes a different bindingcontext using cboMyCombo1.bindingContext
cboMyCombo1.DataSource = ds.Tables["somecolumn"];
cboMyCombo1.DisplayMember = "Descrip";
cboMyCombo1.ValueMember = "ID";
cboMyCombo2.DataSource = ds.Tables["somecolumn"];
cboMyCombo2.DisplayMember = "Descrip";
cboMyCombo2.ValueMember = "ID";
cboMyCombo1.bindingContext
hope this helps
rinze
Business Accounts
Answer for Membership
by: mondayblueboyPosted on 2003-09-18 at 13:37:21ID: 9389297
Q: what did you change?