S
sklett
I wasn't sure how to deal with this, but this is what I cam up with. If
possible, I'd like a little feedback if there is a better way to deal with a
situation where changes in an event handler cause the event to fire.
private void listView_AvailableTests_ItemChecked(object sender,
ItemCheckedEventArgs e)
{
listView_AvailableTests.ItemChecked -=
listView_AvailableTests_ItemChecked;
foreach(ListViewItem item in listView_AvailableTests.Items)
{
if(item != e.Item)
{
item.Checked = false;
}
}
listView_AvailableTests.ItemChecked +=
listView_AvailableTests_ItemChecked;
}
The above code works, but it just seems a little "odd" to me for some reason
;0)
Any and all comments are welcome.
Thanks,
Steve
possible, I'd like a little feedback if there is a better way to deal with a
situation where changes in an event handler cause the event to fire.
private void listView_AvailableTests_ItemChecked(object sender,
ItemCheckedEventArgs e)
{
listView_AvailableTests.ItemChecked -=
listView_AvailableTests_ItemChecked;
foreach(ListViewItem item in listView_AvailableTests.Items)
{
if(item != e.Item)
{
item.Checked = false;
}
}
listView_AvailableTests.ItemChecked +=
listView_AvailableTests_ItemChecked;
}
The above code works, but it just seems a little "odd" to me for some reason
;0)
Any and all comments are welcome.
Thanks,
Steve