Tim Romano
08-25-2002, 06:40 AM
Seeking corroboration.
Anyone here noticing unreliable behavior with ListView CheckedItems and
CheckedIndices when you iterate these collections after having checked an
item, unchecked it, and then checked another?
Display some items with subitems in ListView (in detail view with
checkboxes enabled).
Check an item.
Iterate the CheckedItems | Checked Indices collection and display the
related subitems for the current item|index.
Uncheck the item.
Check another.
Iterate the CheckedItems | Checked Indices collection and display the
related subitems for the current item|index.
In my tests, when iterating these subsets of the Items collection, the
subitems do not always remain in synch with the current item; moreover, I
sometimes have encountered OutOfRange exceptions when i = 0 and
CheckedItems.Count > 0.
The only reliable way has been to iterate the Items collection in its
entirety and query the Checked property.
Tim Romano
Anyone here noticing unreliable behavior with ListView CheckedItems and
CheckedIndices when you iterate these collections after having checked an
item, unchecked it, and then checked another?
Display some items with subitems in ListView (in detail view with
checkboxes enabled).
Check an item.
Iterate the CheckedItems | Checked Indices collection and display the
related subitems for the current item|index.
Uncheck the item.
Check another.
Iterate the CheckedItems | Checked Indices collection and display the
related subitems for the current item|index.
In my tests, when iterating these subsets of the Items collection, the
subitems do not always remain in synch with the current item; moreover, I
sometimes have encountered OutOfRange exceptions when i = 0 and
CheckedItems.Count > 0.
The only reliable way has been to iterate the Items collection in its
entirety and query the Checked property.
Tim Romano