I have 2 combo boxes (cbxround1 and cbxround2) which will have the same data and am using 2 dataviews (dvROUND1 and dvROUND2) to look at them.
The problem is that when I change the selected item in one, it also changes the selected item in the second box. I don't want to do that. I want the 2nd box to look at the next item (if cbxround1.selectedIndex = 1, I want cbxround2.selectedIndex = 2). But when I change cbxround2.selectedIndex = cbxround1.selectedIndex + 1, cbxround1 gets changed also????
They are different views so why does this happen?
Thanks,
Tom.
The problem is that when I change the selected item in one, it also changes the selected item in the second box. I don't want to do that. I want the 2nd box to look at the next item (if cbxround1.selectedIndex = 1, I want cbxround2.selectedIndex = 2). But when I change cbxround2.selectedIndex = cbxround1.selectedIndex + 1, cbxround1 gets changed also????
They are different views so why does this happen?
Code:
Dim daROUND As New OleDb.OleDbDataAdapter(sqlROUND, cnWWR)
Dim dsROUND As New DataSet()
daROUND.Fill(dsROUND, strROUND)
Dim dvROUND1 As DataView = dsROUND.Tables(strROUND).DefaultView
Dim dvROUND2 As DataView = dsROUND.Tables(strROUND).DefaultView
cbxRound1.DataSource = dvROUND1
cbxRound1.DisplayMember = "DESCRIPTION"
cbxRound1.ValueMember = "ROUNDNUM"
cbxRound2.DataSource = dvROUND2
cbxRound2.DisplayMember = "DESCRIPTION"
cbxRound2.ValueMember = "ROUNDNUM"
FirstRoundIndex = cbxRound1.SelectedIndex
SecondRoundIndex = FirstRoundIndex + 1
cbxRound2.SelectedIndex = SecondRoundIndex
Thanks,
Tom.