• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 542
  • Last Modified:

ListView SelectedIndexChanged is firing multiple events

Greetings,

I have handled the SelectedIndexChanged for a ListView, but am finding it's firing three times for one click in the ListView.  I put a breakpoint there and it breaks there three times.  Could this be the interaction with the debugger?

Thanks,
Bob
0
ba272
Asked:
ba272
  • 3
  • 3
  • 2
  • +1
2 Solutions
 
anyoneisCommented:
Probably not a debugger issue.  Everytime a new item is selected, you get a selectedindexchanged with 0 items selected, then with 1. Also, if more than one item is selected, you get multiple selectedindexchanged evnets as each item is added to the selected item list.

David
0
 
HeidarVCommented:
Hello Bob

what is the version of your .net? 1.1 or 2

Thank you,
Heidar
0
 
ba272Author Commented:
.NET 1.1
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
HeidarVCommented:
Hello

Install latest service pack, it may be a bug. I currently use .net 2 and doesn't seem to have this problem.

Good luck
0
 
ba272Author Commented:
HeidarV,

How do I check the version of .NET I am using?

Thanks,
Bob
0
 
HeidarVCommented:
Hello Bob

If you use visual studio 2003 .net is 1.1 and if you use visual studio 2005 .net is version 2.
0
 
ba272Author Commented:
Thanks,
Bob
0
 
Tom KnowltonWeb developerCommented:
In the meantime I even tried setting an "updating" flag before and after I do anything with the UserLIstView, still no luck:
if (!_isupdating)
            {
                try
                {
                    string sID = UserListView.SelectedItems[0].SubItems[0].Text;
                    if (radioButtonEditMode.Checked)
                    {
                        //ResetFields();
                        LoadSpecificUser(Convert.ToInt32(sID));
                    }
                }
                catch (Exception ex)
                {
                    string sTest = ex.Message;
                    MessageBox.Show("Please set the security level");
                    return;
                }
            }

Open in new window

0
 
Tom KnowltonWeb developerCommented:
Sorry, wrong post.  Delete the above, mods, if you like.

tom
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now