Can't seem to be able to set ListViewItem.imageIndex

Posted by TKL on Stack Overflow See other posts from Stack Overflow or by TKL
Published on 2010-05-09T23:40:21Z Indexed on 2010/05/09 23:48 UTC
Read the original article Hit count: 182

Filed under:
|
|

I have been scratching my head with this error for at least an hour, what the heck is wrong here?

In a loop:

if (selectedItems[x].ImageIndex == 3)
                        {
                            List<ListViewItem> dupes = CP.listCache.FindAll(delegate(ListViewItem item) { return item.Text == selectedItems[x].Text; });

                            if (dupes != null && dupes.Count == 1)
                                dupes[0].ImageIndex = 0;
                        }

I can access the imageIndex, but not set it. ArgumentOutOfRange exception occurs.

© Stack Overflow or respective owner

Related posts about c#

Related posts about listviewitem