Combo box
-
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
-
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
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
-
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
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) -
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
-
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?
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