Solved

Selected Index Changed fires twice?

Posted on 2006-11-06
3
306 Views
Last Modified: 2008-03-04
Is it true that Selected Index Changed event ACTUALLY fires twice, once when you leave the row you are on, and once when you "highlight" the new row (the new row receives the focus) ?
0
Comment
Question by:Tom Knowlton
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
ZeonFlash earned 500 total points
ID: 17882426
What control are you referring to?  

I would rather seriously doubt that it does, in any case.  The change event is a single occurrence, much like a light bulb.  When you hit the switch, the bulb CHANGES from Off to On...it doesn't register a state of "in between".  So when, for example, a combobox has a selected index change, it's a single event going from Index A to Index B.  It doesn't go from Index A to Index NULL, then again from Index NULL to Index B.
0
 
LVL 5

Author Comment

by:Tom Knowlton
ID: 17894090
What about ListViews?
0
 
LVL 17

Expert Comment

by:ZeonFlash
ID: 17895392
For ListBoxes, the behavior is the same, and is extended by the SelectionMode:

One - SelectedIndexChanged is fire everytime an item is clicked.
MultiSimple - Fired everytime an item is selected OR de-selected.
MultiExtended - Fired everytime an individual item is clicked (selected or de-selected), but when holding the shift key and clicking, the event only fires once (even though multiple items may have been highlighted)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question