473,842 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Databinding 2 comboboxes to the same Datasource

I am trying to databind 2 combo boxes to the same datasource but different fields using the same lookup table. The information in combobox2 is duplicating combobox 1(ie it appears to be gathering the wrong information) I have verified the proper information through query analyzer....

Me.FormatName1C omboBox.DataSou rce = LabelFormats

Me.FormatName1C omboBox.Display Member = "Formatname "

Me.FormatName1C omboBox.ValueMe mber = "FormatName "

Me.FormatName1C omboBox.DataBin dings.Add(New Binding("Select edValue", ProductsBinding source, "FormatName 1"))

Me.FormatName2C omboBox.DataSou rce = LabelFormats

Me.FormatName2C omboBox.Display Member = "Formatname "

Me.FormatName2C omboBox.ValueMe mber = "FormatName "

Me.FormatName2C omboBox.DataBin dings.Add(New Binding("Select edValue", ProductsBinding source, "FormatName 2"))
--
--Eric Cathell, MCSA
May 16 '06 #1
4 6204
Hi,

The currency manager will keep the 2 comboboxes in sync when they
are bound to the same datasource. Create a dataview to bind one of the
comboboxes to.

Ken
---------------------------

"ECathell" wrote:
I am trying to databind 2 combo boxes to the same datasource but different fields using the same lookup table. The information in combobox2 is duplicating combobox 1(ie it appears to be gathering the wrong information) I have verified the proper information through query analyzer....

Me.FormatName1C omboBox.DataSou rce = LabelFormats

Me.FormatName1C omboBox.Display Member = "Formatname "

Me.FormatName1C omboBox.ValueMe mber = "FormatName "

Me.FormatName1C omboBox.DataBin dings.Add(New Binding("Select edValue", ProductsBinding source, "FormatName 1"))

Me.FormatName2C omboBox.DataSou rce = LabelFormats

Me.FormatName2C omboBox.Display Member = "Formatname "

Me.FormatName2C omboBox.ValueMe mber = "FormatName "

Me.FormatName2C omboBox.DataBin dings.Add(New Binding("Select edValue", ProductsBinding source, "FormatName 2"))
--
--Eric Cathell, MCSA

May 16 '06 #2
A little addition before it is misunderstood

*New* dataview

Cor
May 16 '06 #3
so because they both have the same datasource(look up table) they will stay
in sync? so really then I need to create a second instance of the lookup
datasource....o k...seem redundant since it is the SAME lookup datasource and
bound to different columns of the products datasource...
"Ken Tucker [MVP]" <Ke**********@d iscussions.micr osoft.com> wrote in message
news:3F******** *************** ***********@mic rosoft.com...
Hi,

The currency manager will keep the 2 comboboxes in sync when they
are bound to the same datasource. Create a dataview to bind one of the
comboboxes to.

Ken
---------------------------

"ECathell" wrote:
I am trying to databind 2 combo boxes to the same datasource but
different fields using the same lookup table. The information in
combobox2 is duplicating combobox 1(ie it appears to be gathering the
wrong information) I have verified the proper information through query
analyzer....

Me.FormatName1C omboBox.DataSou rce = LabelFormats

Me.FormatName1C omboBox.Display Member = "Formatname "

Me.FormatName1C omboBox.ValueMe mber = "FormatName "

Me.FormatName1C omboBox.DataBin dings.Add(New Binding("Select edValue",
ProductsBinding source, "FormatName 1"))

Me.FormatName2C omboBox.DataSou rce = LabelFormats

Me.FormatName2C omboBox.Display Member = "Formatname "

Me.FormatName2C omboBox.ValueMe mber = "FormatName "

Me.FormatName2C omboBox.DataBin dings.Add(New Binding("Select edValue",
ProductsBinding source, "FormatName 2"))
--
--Eric Cathell, MCSA

May 16 '06 #4
But as Ken said is the postion of the row by the currencymanager bound

"ECathell" <ec******@nospa m.com> schreef in bericht
news:ux******** *****@TK2MSFTNG P04.phx.gbl...
so because they both have the same datasource(look up table) they will stay
in sync? so really then I need to create a second instance of the lookup
datasource....o k...seem redundant since it is the SAME lookup datasource
and bound to different columns of the products datasource...
"Ken Tucker [MVP]" <Ke**********@d iscussions.micr osoft.com> wrote in
message news:3F******** *************** ***********@mic rosoft.com...
Hi,

The currency manager will keep the 2 comboboxes in sync when they
are bound to the same datasource. Create a dataview to bind one of the
comboboxes to.

Ken
---------------------------

"ECathell" wrote:
I am trying to databind 2 combo boxes to the same datasource but
different fields using the same lookup table. The information in
combobox2 is duplicating combobox 1(ie it appears to be gathering the
wrong information) I have verified the proper information through query
analyzer....

Me.FormatName1C omboBox.DataSou rce = LabelFormats

Me.FormatName1C omboBox.Display Member = "Formatname "

Me.FormatName1C omboBox.ValueMe mber = "FormatName "

Me.FormatName1C omboBox.DataBin dings.Add(New Binding("Select edValue",
ProductsBinding source, "FormatName 1"))

Me.FormatName2C omboBox.DataSou rce = LabelFormats

Me.FormatName2C omboBox.Display Member = "Formatname "

Me.FormatName2C omboBox.ValueMe mber = "FormatName "

Me.FormatName2C omboBox.DataBin dings.Add(New Binding("Select edValue",
ProductsBinding source, "FormatName 2"))
--
--Eric Cathell, MCSA


May 17 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
7688
by: Timothy White | last post by:
I have a Windows Form Which Displays one record at a time. The DataTable object which is bound to the Form Controls only contains the record that is being displayed. When I need to display a different record, any changes in the current record are saved to an Access Database, the DataTable's Row Collection is Cleared and the New Record is read into the DataTable. (This is done to ensure that when the User goes to view a record, they get...
1
6207
by: Stijn Goris | last post by:
Hi all, I have 3 Comboboxes i want to bind with 3 different DatTables. I use this.cbxProductCategory.DataSource = myDataTable; this.cbxProductCategory.DisplayMember = "PTCA_DESCR"; this.cbxProductCategory.ValueMember = "PTCA_CODE"; to bind the data. Although I 'm 100% the data is inside the differnet DataTables.I don't see the values in the comboboxes. When I only bind one DataTable to one combobox
5
4353
by: david.kao | last post by:
Hi All: I have a dataset contains two tables, one parent child relation between two tables. I have no trouble to bind parent table to a combobox, relation to a win grid control. But I am having trouble to bind relation into another combo box. DotNet does not give me a run time error. But it did not perform the way I am expecting. Thanks in advance DK
1
3629
by: Gary Shell | last post by:
I have a pair of combo boxes on a form. Both have their SelectedValue property bound to a column on a table called "Input_Output". One column is called "Class" and the second is called "SubClass". Each combobox has its datasource, displaymember and SelectedValue member bound to separate tables thru individual datatsets thru individual data adapters. The two tables are "Class" and "SubClass". I use parameterized query to populate the...
2
2408
by: Bruno Rodrigues | last post by:
The controls in my form are bounded to a datasource, including textboxes, comboboxes, etc... Something lame happens: In runtime, the last focused control before clicking on my save button, doesn't have its datasource bounded value refreshed with the new data inputed. I think the control's LostFocus event it's not properly fired when I click a ToolStrip button, and the databinding is not updated. I came with the following piece of code on...
8
2191
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got answered... In 1.1 we always did our own myDataAdapter.fills and we liked that control for lots of good reasons. Now the new DataSource (or is it a TableAdapter:Dataset) automatically fills the Gridview. How can we control that fill? In a...
5
4062
by: Anthony Bollinger | last post by:
I have two tables in a master-detail relationship. When I make a selection in one combobox, how do I have it display the values from a second combobox? Each table has a key and a text value for each record. I don't yet see the way to update the list of values in the second combobox. Thanks for any input, Tony
7
13537
by: JTC^..^ | last post by:
When i attempt to bind to the "Text" and "Value" property of a combobox on a windows form the value is reset when I leave the combobox. The comboboxes contain the correct Text and Values. I know this as the Value property binds correctly on it own. It is only when I bind the "Text" and "Value" that the issue occurs. The following sample code includes my custom classes and the Form Clode. I have several comboboxes and customer classes...
0
1317
by: theleshie | last post by:
Hi, I am creating an application which dynamically creates forms depending on the information held in a dataset (which also includes the data the application itself uses). As part of dynamically creating these forms, I need to bind controls back to their underlying tables. This has been successful with textboxes, but I am having a lot of difficulty with comboboxes. Setting the datasource to the bindinglist seems to be ok, but I am having...
0
9872
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10314
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9453
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7038
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5696
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5885
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4499
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4089
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3145
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.