Connecting Tech Pros Worldwide Help | Site Map

Problem with ListView and OnSelectedIndexChanged

  #1  
Old November 15th, 2005, 04:30 PM
Noxis
Guest
 
Posts: n/a
I'm having problems with the OnSelectedIndexChanged event firing twice
when a ListView item is selected and not at all if I click on an
already selected index. I've read older postings and other people
seem to have experienced the same problem, but it seems that it hasn't
been addressed.

If anyone can help, I would really appreciate it,
Thanks
  #2  
Old November 15th, 2005, 04:31 PM
Champika Nirosh
Guest
 
Posts: n/a

re: Problem with ListView and OnSelectedIndexChanged


What happen there is the event get fire as you lost the focus as well as get
the focus I mean in both the case it is a selected index change... quite
understandably if you select the already selected item again then the event
is not fired since you have not change the slected index of the item

Nirosh.

"Noxis" <maxwellpatten@hotmail.com> wrote in message
news:23122923.0311261458.21a737ab@posting.google.c om...[color=blue]
> I'm having problems with the OnSelectedIndexChanged event firing twice
> when a ListView item is selected and not at all if I click on an
> already selected index. I've read older postings and other people
> seem to have experienced the same problem, but it seems that it hasn't
> been addressed.
>
> If anyone can help, I would really appreciate it,
> Thanks[/color]


  #3  
Old November 15th, 2005, 04:32 PM
Noxis
Guest
 
Posts: n/a

re: Problem with ListView and OnSelectedIndexChanged


Ok, that makes sense (thanks for the prompt reply). Is there an event
to capture the reselection of an item?

"Champika Nirosh" <cnirosh@textcentric.lk> wrote in message news:<#F79nLKtDHA.2508@TK2MSFTNGP12.phx.gbl>...[color=blue]
> What happen there is the event get fire as you lost the focus as well as get
> the focus I mean in both the case it is a selected index change... quite
> understandably if you select the already selected item again then the event
> is not fired since you have not change the slected index of the item
>
> Nirosh.
>
> "Noxis" <maxwellpatten@hotmail.com> wrote in message
> news:23122923.0311261458.21a737ab@posting.google.c om...[color=green]
> > I'm having problems with the OnSelectedIndexChanged event firing twice
> > when a ListView item is selected and not at all if I click on an
> > already selected index. I've read older postings and other people
> > seem to have experienced the same problem, but it seems that it hasn't
> > been addressed.
> >
> > If anyone can help, I would really appreciate it,
> > Thanks[/color][/color]
  #4  
Old November 15th, 2005, 04:34 PM
Champika Nirosh
Guest
 
Posts: n/a

re: Problem with ListView and OnSelectedIndexChanged


I think you have to use the mouse click/ down event and get the
corresponding item by
listView1.GetItemAt(x, y);

Nirosh.

"Noxis" <maxwellpatten@hotmail.com> wrote in message
news:23122923.0311270500.662a04b@posting.google.co m...[color=blue]
> Ok, that makes sense (thanks for the prompt reply). Is there an event
> to capture the reselection of an item?
>
> "Champika Nirosh" <cnirosh@textcentric.lk> wrote in message[/color]
news:<#F79nLKtDHA.2508@TK2MSFTNGP12.phx.gbl>...[color=blue][color=green]
> > What happen there is the event get fire as you lost the focus as well as[/color][/color]
get[color=blue][color=green]
> > the focus I mean in both the case it is a selected index change... quite
> > understandably if you select the already selected item again then the[/color][/color]
event[color=blue][color=green]
> > is not fired since you have not change the slected index of the item
> >
> > Nirosh.
> >
> > "Noxis" <maxwellpatten@hotmail.com> wrote in message
> > news:23122923.0311261458.21a737ab@posting.google.c om...[color=darkred]
> > > I'm having problems with the OnSelectedIndexChanged event firing twice
> > > when a ListView item is selected and not at all if I click on an
> > > already selected index. I've read older postings and other people
> > > seem to have experienced the same problem, but it seems that it hasn't
> > > been addressed.
> > >
> > > If anyone can help, I would really appreciate it,
> > > Thanks[/color][/color][/color]


  #5  
Old November 15th, 2005, 04:36 PM
Noxis
Guest
 
Posts: n/a

re: Problem with ListView and OnSelectedIndexChanged


I started using the OnEnter event, but may be the mouse click down
event is more direct. Thanks a lot for your advice... I owe you a
beer :)

Noxis

"Champika Nirosh" <cnirosh@textcentric.lk> wrote in message news:<#BaP99VtDHA.3224@tk2msftngp13.phx.gbl>...[color=blue]
> I think you have to use the mouse click/ down event and get the
> corresponding item by
> listView1.GetItemAt(x, y);
>
> Nirosh.
>
> "Noxis" <maxwellpatten@hotmail.com> wrote in message
> news:23122923.0311270500.662a04b@posting.google.co m...[color=green]
> > Ok, that makes sense (thanks for the prompt reply). Is there an event
> > to capture the reselection of an item?
> >
> > "Champika Nirosh" <cnirosh@textcentric.lk> wrote in message[/color]
> news:<#F79nLKtDHA.2508@TK2MSFTNGP12.phx.gbl>...[color=green][color=darkred]
> > > What happen there is the event get fire as you lost the focus as well as[/color][/color]
> get[color=green][color=darkred]
> > > the focus I mean in both the case it is a selected index change... quite
> > > understandably if you select the already selected item again then the[/color][/color]
> event[color=green][color=darkred]
> > > is not fired since you have not change the slected index of the item
> > >
> > > Nirosh.
> > >
> > > "Noxis" <maxwellpatten@hotmail.com> wrote in message
> > > news:23122923.0311261458.21a737ab@posting.google.c om...
> > > > I'm having problems with the OnSelectedIndexChanged event firing twice
> > > > when a ListView item is selected and not at all if I click on an
> > > > already selected index. I've read older postings and other people
> > > > seem to have experienced the same problem, but it seems that it hasn't
> > > > been addressed.
> > > >
> > > > If anyone can help, I would really appreciate it,
> > > > Thanks[/color][/color][/color]
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
race condition? Berryl Hesh answers 7 October 27th, 2008 04:15 AM
c# ListView selection change Jure Bogataj answers 5 October 17th, 2007 09:35 AM
listview problem amber answers 3 November 20th, 2005 08:20 PM