?
Solved

Selected Index Changed fires twice?

Posted on 2006-11-06
3
Medium Priority
?
321 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
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…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

839 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