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. C#
  4. Combo box

Combo box

Scheduled Pinned Locked Moved C#
helpquestion
5 Posts 3 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.
  • J Offline
    J Offline
    jonhbt
    wrote on last edited by
    #1

    I am setting the data source of a combo box in the form constructor. the problem is that when the page is loaded and the data is being loaded in a combo box the selectedindexchanged event is being triggered. i don't want that to happen. how can I tackle that problem please? Thanks for the help

    N D 2 Replies Last reply
    0
    • J jonhbt

      I am setting the data source of a combo box in the form constructor. the problem is that when the page is loaded and the data is being loaded in a combo box the selectedindexchanged event is being triggered. i don't want that to happen. how can I tackle that problem please? Thanks for the help

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      A common problem. You can either set an internal flag that tells whether the combo is being loaded during initialization or disable the events and reenable them after the combo has been loaded.


      only two letters away from being an asset

      J 1 Reply Last reply
      0
      • J jonhbt

        I am setting the data source of a combo box in the form constructor. the problem is that when the page is loaded and the data is being loaded in a combo box the selectedindexchanged event is being triggered. i don't want that to happen. how can I tackle that problem please? Thanks for the help

        D Offline
        D Offline
        DaveyM69
        wrote on last edited by
        #3

        Subscribe to the SelectedIndexChanged event after the page load?

        Dave
        BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
        Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
        Why are you using VB6? Do you hate yourself? (Christian Graus)

        1 Reply Last reply
        0
        • N Not Active

          A common problem. You can either set an internal flag that tells whether the combo is being loaded during initialization or disable the events and reenable them after the combo has been loaded.


          only two letters away from being an asset

          J Offline
          J Offline
          jonhbt
          wrote on last edited by
          #4

          I am using a flag but the problem is that the selected value remains the same even though I change the selection. how can I solve that please?

          N 1 Reply Last reply
          0
          • J jonhbt

            I am using a flag but the problem is that the selected value remains the same even though I change the selection. how can I solve that please?

            N Offline
            N Offline
            Not Active
            wrote on last edited by
            #5

            What do you mean, "the selected value remains the same even though I change the selection"? You're original question was how to work around the event firing during initialization. Now, however, it seems the problem is something else. If you want help around here state the problem clearly. Read the first post, How to get an answer to your question.


            only two letters away from being an asset

            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