Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows Forms
  4. comboboxcontrol on Winform2008

comboboxcontrol on Winform2008

Scheduled Pinned Locked Moved Windows Forms
8 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vinayh
    wrote on last edited by
    #1

    I am having two comboboxcontrol on Winform2008, whenever I am selecting value from one combo , then same text is coming in second combo, but just I want to separation in both ..

    Vinay

    D D 2 Replies Last reply
    0
    • V vinayh

      I am having two comboboxcontrol on Winform2008, whenever I am selecting value from one combo , then same text is coming in second combo, but just I want to separation in both ..

      Vinay

      D Offline
      D Offline
      darkelv
      wrote on last edited by
      #2

      Use different datasource for each combobox, even if the data are the same.

      V D 2 Replies Last reply
      0
      • D darkelv

        Use different datasource for each combobox, even if the data are the same.

        V Offline
        V Offline
        vinayh
        wrote on last edited by
        #3

        thanks

        Vinay

        1 Reply Last reply
        0
        • V vinayh

          I am having two comboboxcontrol on Winform2008, whenever I am selecting value from one combo , then same text is coming in second combo, but just I want to separation in both ..

          Vinay

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          All you need to do is create two BindingSource objects and put them between the Combo's and the data. Each Combo will have its DataSource property set to one of the BindingSource objects. Then each BindingSource will have it's DataSource property point to the same data object. Something like this:

          ComboBox1.DataSource ------> BindingSource1 -----\\
                                                            \\
                                                             +----> Data
                                                            /
          ComboBox2.DataSource ------> BindingSource2 -----/
          

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008
          But no longer in 2009...

          M 1 Reply Last reply
          0
          • D darkelv

            Use different datasource for each combobox, even if the data are the same.

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            So are you saying that each combo should point to a different copy of the save data? Isn't that a little inefficient??

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008
            But no longer in 2009...

            1 Reply Last reply
            0
            • D Dave Kreskowiak

              All you need to do is create two BindingSource objects and put them between the Combo's and the data. Each Combo will have its DataSource property set to one of the BindingSource objects. Then each BindingSource will have it's DataSource property point to the same data object. Something like this:

              ComboBox1.DataSource ------> BindingSource1 -----\\
                                                                \\
                                                                 +----> Data
                                                                /
              ComboBox2.DataSource ------> BindingSource2 -----/
              

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007, 2008
              But no longer in 2009...

              M Offline
              M Offline
              Mycroft Holmes
              wrote on last edited by
              #6

              See that's why I skulk around here, I have used the table.copy method to achieve this in the past as I have never used a bindingsource as a datasource for a combo. Thanks Dave

              Never underestimate the power of human stupidity RAH

              D 1 Reply Last reply
              0
              • M Mycroft Holmes

                See that's why I skulk around here, I have used the table.copy method to achieve this in the past as I have never used a bindingsource as a datasource for a combo. Thanks Dave

                Never underestimate the power of human stupidity RAH

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #7

                Glad it'll help you. It's just a little something I found in someone elses brain droppings. :-D

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007, 2008
                But no longer in 2009...

                L 1 Reply Last reply
                0
                • D Dave Kreskowiak

                  Glad it'll help you. It's just a little something I found in someone elses brain droppings. :-D

                  A guide to posting questions on CodeProject[^]
                  Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                       2006, 2007, 2008
                  But no longer in 2009...

                  L Offline
                  L Offline
                  Luc Pattyn
                  wrote on last edited by
                  #8

                  Dave Kreskowiak wrote:

                  It's just a little something I found in someone elses brain droppings

                  Yikes. The things you poke in. :~

                  Luc Pattyn [Forum Guidelines] [My Articles]


                  The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups