Home All Groups Group Topic Archive Search About

Listview ItemSelectionChanged vs SelectedIndexChanged events

Author
30 Aug 2006 5:27 PM
Dean Slindee
The listview events "ItemSelectionChanged" and "SelectedIndexChanged" events
appear to both fire when someone clicks on a different item in a listview.
Is there some reason to use one event over another?



Thanks,

Dean S

Author
30 Aug 2006 7:39 PM
Dave Kreskowiak
There's no reason to use either event that's dictated by the control, no. 
Which you use depends on the requirements of your own code.

ItemSelectionChanged will return the instance of the item who's selection
has changed, where as SelectedIndexChanged will just notify you that a
selection change was made.  It won't tell you which item changed.

--
<i><b>RageInTheMachine9532</b></i><font size="-2">
"<i>...a pungent, ghastly, stinky piece of cheese!</i>" <b>-- The Roaming
Gnome</b></font>


Show quoteHide quote
"Dean Slindee" wrote:

> The listview events "ItemSelectionChanged" and "SelectedIndexChanged" events
> appear to both fire when someone clicks on a different item in a listview.
> Is there some reason to use one event over another?
>
>
>
> Thanks,
>
> Dean S
>
>
>