By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,183 Members | 1,212 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,183 IT Pros & Developers. It's quick & easy.

Displayindex error for listview

P: n/a
Hello. I am getting an error when trying to remove/access items inside of a
listview:

System.ArgumentOutOfRangeException: Specified argument was out of the range
of valid values.
Parameter name: '500' is not a valid value for 'displayIndex'.

I only remove item 500 from the listview if the number of items is greater
than 500 (so it removes the last item). Also, I am updating items in the
listview with code:

try
for each node in listview.items
if node.subitems(1).text = *what i'm looking for* then
node.subitems(2).text = "Whatever"
end if
next node
catch
end try

Now here's the fun fact: Adding, updating and removing items from the
listview are all contained in separate try blocks. Adding and updating
items are called from another class via raised events.

What is causing this error and how do I fix it?

Thanks,

Ryan
Nov 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.