Results 1 to 2 of 2

Thread: Databinding to multiple combo-boxes.

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Location
    Växjö - Sweden
    Posts
    2

    Databinding to multiple combo-boxes.

    Hi there

    This is probably a newbie question but here it goes:

    I have through databinding and a dataset, bound data to a combobox:

    Combobox1.DataSource = Dataset1.cbdata.DefaultView
    Combobox1.ValueMember = Dataset1.cbdata.cbdataIDColumn.ToString
    Combobox1.DisplayMember = Dataset1.cbdata.cbdataColumn.ToString

    Now the thing is this I have a second combobox (Combobox2) that I have bound to the same data:

    Combobox2.DataSource = Dataset1.cbdata.DefaultView
    Combobox2.ValueMember = Dataset1.cbdata.cbdataIDColumn.ToString
    Combobox2.DisplayMember = Dataset1.cbdata.cbdataColumn.ToString

    Now in my form, at runtime when I choose something in Combobox1, Combobox2 automatically gets the same value??? It changes as if It was set to be equal to combobox1 in some way, but I have no such code at all.

    I have this problem (or feature?) when using dataview's as well.

    Any help would be appreciated greatly....
    The universe is a big place, perhaps the biggest!

  2. #2

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Location
    Växjö - Sweden
    Posts
    2
    Well I guess solving it using multiple dataadapters is one way, which Im currently using.

    Any comments on this, tips or other workarounds would still be very welcome.
    The universe is a big place, perhaps the biggest!

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