mxdog
mxdog

Reputation: 51

In C# Forms How to Trap or Isolate when a Listview box is done updating with multiple selections?

The app I am working on allows the user to select multiple items in a listView box using mouse clicks or keyboard , standard windows selection stuff, the trouble I am having is figuring out a way to know when the listview box is done updating the selections so I can run a routine on the final selections. Both the events listView1_SelectedIndexChanged and listView1_ItemSelectionChanged fire multiple times with more then one item selected which I suppose is expected behavior. I have tried listView1_MouseClick which actually works as a final selection(s) entry point but then I am not sure how to handle keyboard selection in the same way as the mouse click event which doesn't involve the ItemSelectionChanged or index changed events. There should be a simple way to do this I am just not finding it with the available events for this control. The below screen shots show the events fired with a typical selection "2" was already selected to start. As you can see the SelectedIndexChanged event fired one time for each new selection I need to determine when the control is done updating the selections. The selections can be 1 to 100's if not thousands.

Events OutputSelections Box

Upvotes: 0

Views: 60

Answers (0)

Related Questions