ListView.ItemCheck event fires on ListView.Items.Insert

G

Guest

I have a C# form that uses a ListView with check boxes. Its items are ordered
within the checked and unchecked groups. To move an item from the checked
group to the unchecked group when the user unchecks it, I first remove the
ListViewItem and then insert it in its new index. The problem is that when I
insert it, the ItemCheck event fires again.

First time:
e.CurrentValue = Checked
e.NewValue = Unchecked

Next time:
e.CurrentValue = Unchecked
e.NewValue = Checked

Does anyone know why this happens and how to handle it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top