473,320 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Problem with ListView and OnSelectedIndexChanged

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
Nov 15 '05 #1
4 5118
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" <ma***********@hotmail.com> wrote in message
news:23**************************@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

Nov 15 '05 #2
Ok, that makes sense (thanks for the prompt reply). Is there an event
to capture the reselection of an item?

"Champika Nirosh" <cn*****@textcentric.lk> wrote in message news:<#F**************@TK2MSFTNGP12.phx.gbl>...
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" <ma***********@hotmail.com> wrote in message
news:23**************************@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

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

Nirosh.

"Noxis" <ma***********@hotmail.com> wrote in message
news:23*************************@posting.google.co m...
Ok, that makes sense (thanks for the prompt reply). Is there an event
to capture the reselection of an item?

"Champika Nirosh" <cn*****@textcentric.lk> wrote in message

news:<#F**************@TK2MSFTNGP12.phx.gbl>...
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" <ma***********@hotmail.com> wrote in message
news:23**************************@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

Nov 15 '05 #4
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" <cn*****@textcentric.lk> wrote in message news:<#B**************@tk2msftngp13.phx.gbl>...
I think you have to use the mouse click/ down event and get the
corresponding item by
listView1.GetItemAt(x, y);

Nirosh.

"Noxis" <ma***********@hotmail.com> wrote in message
news:23*************************@posting.google.co m...
Ok, that makes sense (thanks for the prompt reply). Is there an event
to capture the reselection of an item?

"Champika Nirosh" <cn*****@textcentric.lk> wrote in message

news:<#F**************@TK2MSFTNGP12.phx.gbl>...
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" <ma***********@hotmail.com> wrote in message
news:23**************************@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

Nov 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Steph. | last post by:
I use a ListView in a form to display Data from an SQL db. My problem is that I can fill the listview in less than a second when I show the form AFTER filling the listview, but I take 35...
1
by: J_Max | last post by:
Hello, This might be a really easy question, but... I am developing a simple Smart Device application that uses a listview. I have a function that adds a item to the listview - code is below. I...
4
by: alan | last post by:
Hello, Can ListView have some event just like the event BeforeSelect of TreeView? When a user try to select another item in the ListView, I would like to do some checking first. If the result...
6
by: Roshawn | last post by:
Hi, I have a DDL server control on my web form. I'm having difficulty trying to fire the OnSelectedIndexChanged event. I've specified a procedure to handle the event. Whenever I changed the...
1
by: Paul L | last post by:
Hi, I have an issue with the OnSelectedIndexChanged event not firing for a DropDownList control which is in the ItemTemplate of a DataList. I have made an exact copy of the DropDownList control,...
3
by: amber | last post by:
I have a listview (lstvwAmend) (containing 2 columns) that is populated by a filtered dataview (dvRPA) that is based on a dataset (dsRPAmend1) pulling data from a SQL Server database This dataview...
12
by: garyusenet | last post by:
I have had no replies to my previous post so perhaps I didn't write it good enough. Please excuse new thread but i wanted to break from the last thread hopefully this thread will be better. ...
2
by: Paul W | last post by:
Hello, My problem concerns the shell. If there's a better forum for this post, please let me know. I'm trying to create a ListView control that displays the contents of a folder with all the...
4
by: qasd3 | last post by:
Hi, I just have a problem that I can not workout a solution to. I have a gridview which gets a bunch of controls created dynamically. What I want to be able to do is have one dropdownlist...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.