Solved

Selected Index Changed fires twice?

Posted on 2006-11-06
3
303 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: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: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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

816 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now