ListView.ItemCheck event fires on ListView.Items.Insert

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
Back
Top