Problem with ListView and OnSelectedIndexChanged 
November 15th, 2005, 04:30 PM
| | | |
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 | 
November 15th, 2005, 04:31 PM
| | | | 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] | 
November 15th, 2005, 04:32 PM
| | | | 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] | 
November 15th, 2005, 04:34 PM
| | | | 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] | 
November 15th, 2005, 04:36 PM
| | | | 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] |  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 225,662 network members.
|