Results 1 to 6 of 6

Thread: [RESOLVED] [2005] data binding issue

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Location
    New Jersey, USA
    Posts
    119

    Resolved [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()

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Location
    New Jersey, USA
    Posts
    119

    Re: [2005] data binding issue

    nothing?
    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()

  3. #3
    Hyperactive Member NPassero's Avatar
    Join Date
    May 2007
    Location
    NJ
    Posts
    272

    Re: [2005] data binding issue

    Why not just load the data into the combo boxes separately without binding them to a data source ?

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Location
    New Jersey, USA
    Posts
    119

    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()

  5. #5
    Hyperactive Member NPassero's Avatar
    Join Date
    May 2007
    Location
    NJ
    Posts
    272

    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.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Location
    New Jersey, USA
    Posts
    119

    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
  •  



Click Here to Expand Forum to Full Width