Databindings question

W

whaletyr

If have a problem

I have 2 comboboxed on the same form
both are filled with the same data. with datasource and displaymember in
the properties defiened.

My problem is that if I select 1 item in combobox1 combobox 2 also chanches
but I dont want that.. where should i look for an answer to this problem?

Thanks
Whaletyr
 
S

S. Justin Gengo

Whaletyr,

Could you post your code?

That would certainly help us figure it out.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
W

whaletyr

Ill try :)

The adapter i made by draging the Dbase into the form
I Use databinding for both the cbox-es
Datasource = weaponry1.weapons

But now if i select one in boxRED boxBlue also chanches


here is the code...

any tips would help greatly


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Weaponry1.Clear()

OleDbDataAdapter1.Fill(Weaponry1)

End Sub





Private Sub cboxred_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles cboxred.SelectedIndexChanged

If lboxred.Items.Count < Redunits Then

Dim RedXP(Redunits) As Integer

Dim RedTrain(Redunits) As Integer

Dim redunit(Redunits) As String

RedXP(counter) = InputBox("What is the Units Experience?")

RedTrain(counter) = InputBox("What is the Units Training?")

redunit(counter) = cboxred.SelectedText.ToString & " " & RedXP(counter) &
"/" & RedTrain(counter)

lboxred.Items.Add(redunit(counter))

End If

End Sub





Private Sub cboxblue_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles cboxblue.SelectedIndexChanged

If lboxblue.Items.Count < blueunits Then

Dim blueXP(Redunits) As Integer

Dim blueTrain(Redunits) As Integer

Dim blueunit(Redunits) As String



blueXP(counter) = InputBox("What is the Units Experience?")

blueTrain(counter) = InputBox("What is the Units Training?")

blueunit(counter) = cboxblue.SelectedText.ToString & " " & blueXP(counter) &
"/" & blueTrain(counter)

lboxblue.Items.Add(blueunit(counter))

End If

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top