|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Databinding 2 comboboxes to the same DatasourceMe.FormatName1ComboBox.DataSource = LabelFormats Me.FormatName1ComboBox.DisplayMember = "Formatname" Me.FormatName1ComboBox.ValueMember = "FormatName" Me.FormatName1ComboBox.DataBindings.Add(New Binding("SelectedValue", ProductsBindingsource, "FormatName1")) Me.FormatName2ComboBox.DataSource = LabelFormats Me.FormatName2ComboBox.DisplayMember = "Formatname" Me.FormatName2ComboBox.ValueMember = "FormatName" Me.FormatName2ComboBox.DataBindings.Add(New Binding("SelectedValue", ProductsBindingsource, "FormatName2")) -- --Eric Cathell, MCSA 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 --------------------------- Show quoteHide quote "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.FormatName1ComboBox.DataSource = LabelFormats > > Me.FormatName1ComboBox.DisplayMember = "Formatname" > > Me.FormatName1ComboBox.ValueMember = "FormatName" > > Me.FormatName1ComboBox.DataBindings.Add(New Binding("SelectedValue", ProductsBindingsource, "FormatName1")) > > Me.FormatName2ComboBox.DataSource = LabelFormats > > Me.FormatName2ComboBox.DisplayMember = "Formatname" > > Me.FormatName2ComboBox.ValueMember = "FormatName" > > Me.FormatName2ComboBox.DataBindings.Add(New Binding("SelectedValue", ProductsBindingsource, "FormatName2")) > > > -- > --Eric Cathell, MCSA so because they both have the same datasource(lookup table) they will stay
in sync? so really then I need to create a second instance of the lookup datasource....ok...seem redundant since it is the SAME lookup datasource and bound to different columns of the products datasource... Show quoteHide quote "Ken Tucker [MVP]" <KenTucker***@discussions.microsoft.com> wrote in message news:3FE56675-9C77-410D-8890-B187C286222C@microsoft.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.FormatName1ComboBox.DataSource = LabelFormats >> >> Me.FormatName1ComboBox.DisplayMember = "Formatname" >> >> Me.FormatName1ComboBox.ValueMember = "FormatName" >> >> Me.FormatName1ComboBox.DataBindings.Add(New Binding("SelectedValue", >> ProductsBindingsource, "FormatName1")) >> >> Me.FormatName2ComboBox.DataSource = LabelFormats >> >> Me.FormatName2ComboBox.DisplayMember = "Formatname" >> >> Me.FormatName2ComboBox.ValueMember = "FormatName" >> >> Me.FormatName2ComboBox.DataBindings.Add(New Binding("SelectedValue", >> ProductsBindingsource, "FormatName2")) >> >> >> -- >> --Eric Cathell, MCSA But as Ken said is the postion of the row by the currencymanager bound
Show quoteHide quote "ECathell" <ecathell@nospam.com> schreef in bericht news:uxpV$RReGHA.380@TK2MSFTNGP04.phx.gbl... > so because they both have the same datasource(lookup table) they will stay > in sync? so really then I need to create a second instance of the lookup > datasource....ok...seem redundant since it is the SAME lookup datasource > and bound to different columns of the products datasource... > > > "Ken Tucker [MVP]" <KenTucker***@discussions.microsoft.com> wrote in > message news:3FE56675-9C77-410D-8890-B187C286222C@microsoft.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.FormatName1ComboBox.DataSource = LabelFormats >>> >>> Me.FormatName1ComboBox.DisplayMember = "Formatname" >>> >>> Me.FormatName1ComboBox.ValueMember = "FormatName" >>> >>> Me.FormatName1ComboBox.DataBindings.Add(New Binding("SelectedValue", >>> ProductsBindingsource, "FormatName1")) >>> >>> Me.FormatName2ComboBox.DataSource = LabelFormats >>> >>> Me.FormatName2ComboBox.DisplayMember = "Formatname" >>> >>> Me.FormatName2ComboBox.ValueMember = "FormatName" >>> >>> Me.FormatName2ComboBox.DataBindings.Add(New Binding("SelectedValue", >>> ProductsBindingsource, "FormatName2")) >>> >>> >>> -- >>> --Eric Cathell, MCSA > >
Frustrated trying to use "pure" VS.NET to access database properties
ADO.NET Error Export to excel without using office automation Detect if Themes are enabled? SQLConnection Setting focus VS2003 and VS2005 Side by Side Dynamically Create Timers are Run-Time VB Express - How to access query value on my form? Opposite of Graphics.FromImage |
|||||||||||||||||||||||