Databinding 2 comboboxes to the same Datasource

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ECathell

    #1

    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
  • Ken Tucker [MVP]

    #2
    RE: Databinding 2 comboboxes to the same Datasource

    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:
    [color=blue]
    > 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[/color]

    Comment

    • Cor Ligthert [MVP]

      #3
      Re: Databinding 2 comboboxes to the same Datasource

      A little addition before it is misunderstood

      *New* dataview

      Cor


      Comment

      • ECathell

        #4
        Re: Databinding 2 comboboxes to the same Datasource

        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]" <KenTuckerMVP@d iscussions.micr osoft.com> wrote in message
        news:3FE56675-9C77-410D-8890-B187C286222C@mi crosoft.com...[color=blue]
        > 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:
        >[color=green]
        >> 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[/color][/color]


        Comment

        • Cor Ligthert [MVP]

          #5
          Re: Databinding 2 comboboxes to the same Datasource

          But as Ken said is the postion of the row by the currencymanager bound

          "ECathell" <ecathell@nospa m.com> schreef in bericht
          news:uxpV$RReGH A.380@TK2MSFTNG P04.phx.gbl...[color=blue]
          > 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]" <KenTuckerMVP@d iscussions.micr osoft.com> wrote in
          > message news:3FE56675-9C77-410D-8890-B187C286222C@mi crosoft.com...[color=green]
          >> 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:
          >>[color=darkred]
          >>> 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[/color][/color]
          >
          >[/color]


          Comment

          Working...