|
-
Jun 11th, 2007, 10:01 AM
#1
Thread Starter
Lively Member
[RESOLVED] [2005] data binding issue
Hi all
I have two comboboxes on a form, both with the same datatable object as their Datasource. when i select an item in one of the boxes, the other box also jumps to that item. They need to be exclusive... a change to one cannot make a change to the other. To resolve this, i tried making a function that returns a clone of a datatable with all of its rows imported, and setting the second combobox's datasource to the output of this function, sending the function the original datatable as input. for some reason, when i add a row to the datatable, and reset the databind on the second combobox by setting it to the datatable replication function's output, the changes do not show up in the combobox.
Is there another way to make two controls set to the same datasource exclusive? (without physically looping through the datarows one at a time and assigning the string values to the combobox)
Dim person As New Person
Person.GrowUp(ByVal school as string, ByVal gang as string, Byval family as string)
Person.Work
Dim A as Integer
For A = 1 to 10
Person.Marry()
Person.Divorce()
Next
Person.GiveUp()
Person.Die()
-
Jun 11th, 2007, 10:46 AM
#2
Thread Starter
Lively Member
Re: [2005] data binding issue
Dim person As New Person
Person.GrowUp(ByVal school as string, ByVal gang as string, Byval family as string)
Person.Work
Dim A as Integer
For A = 1 to 10
Person.Marry()
Person.Divorce()
Next
Person.GiveUp()
Person.Die()
-
Jun 11th, 2007, 10:52 AM
#3
Hyperactive Member
Re: [2005] data binding issue
Why not just load the data into the combo boxes separately without binding them to a data source ?
-
Jun 11th, 2007, 11:01 AM
#4
Thread Starter
Lively Member
Re: [2005] data binding issue
because i have a valuemember and a displaymember.
i want the combobox to display a name of a formula in the drop down, and return a value string representing a formula you are selecting by name.
if i loop through and load the data in like you are suggesting, i will need to do a table.Select() function to find the function i am looking for.
also, it will be messier code.
Dim person As New Person
Person.GrowUp(ByVal school as string, ByVal gang as string, Byval family as string)
Person.Work
Dim A as Integer
For A = 1 to 10
Person.Marry()
Person.Divorce()
Next
Person.GiveUp()
Person.Die()
-
Jun 11th, 2007, 11:03 AM
#5
Hyperactive Member
Re: [2005] data binding issue
what you could do is load it into one, and then transpose it from the first to the second without binding the second one..
just throwing out some ideas.
-
Jun 11th, 2007, 11:14 AM
#6
Thread Starter
Lively Member
Re: [2005] data binding issue
that might work. i resolved to use two seperate datatables. not an overhead issue, because the data list is relatively small.
thanks for your help.
Dim person As New Person
Person.GrowUp(ByVal school as string, ByVal gang as string, Byval family as string)
Person.Work
Dim A as Integer
For A = 1 to 10
Person.Marry()
Person.Divorce()
Next
Person.GiveUp()
Person.Die()
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|