473,747 Members | 3,014 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Displayindex error for listview

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

System.Argument OutOfRangeExcep tion: 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
0 1145

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1279
by: trialproduct2004 | last post by:
Hi all i am having problem in listview which i am using in vb.net applicication At a time of calling method items.clear i am getting error that 'error :- can not obtain value'. And listview is not getting cleared. Can some one tell me reason behind this problem Please help me. Thanks in advance.
8
1212
by: Boris | last post by:
Hi folks! Look at the code: using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data;
0
929
by: Tom | last post by:
Hi, I built a web application which uses Listview (written by c# and xml). I test it without problem on local machine. However it occurs the following error when I install it on remote server. Load Data or Query Error, Please check Configure and Server. 500 Internal Server Error
0
1349
by: alan | last post by:
Dear all, I'm trying to do a data binding for a ListView and I rewrite the code from some example but there is a error while I execute. Can anybody tell me what's wrong with it?? Thank you!! Alan Error message is
0
1562
by: c j anderson, mcp | last post by:
Synopsis: DataGridViewColumn reorder does not update display, but a repopulation of underlying dataset does... I must be missing something obvious. I have a scenario where the underlying XML data schema may change and need to populate a datagrid with the result. The row data will always consist of one simple string element with multiple attributes -- the number and names of the attributes may change. When the data is read in by the...
4
3753
by: Ken | last post by:
I am adding items to a listview and I get an exception that seems to be random. "500 is not a valid value for displayindex" I have searched the web looking for others with this problem and have found a few. The problem is: I've found no real explanation/solution to the problem - yet. Someone has to know what this is - and how to handle it.
2
1362
by: Tenowg | last post by:
Hey everyone.. I know the code below is a mess, but I have no idea what is going wrong. I am getting an MDR error whenever I do the foreach loop. If I comment out the loop it works fine, but ofcourse I only get one addition into my listview. Also the loop is not what is throwing the error, if I comment everything but the message box it works. If anyone has any ideas (feel free to slap me arround for some thing stupid) private void...
0
2069
by: news.microsoft.com | last post by:
Hello.. I'm having an issue setting the DisplayIndex for my DataGridViewColumns The dataViewGrid is bound to a class derived from List<T> I'm doing something like: myDataViewGrid.Columns.DisplayIndex = 0 myDataViewGrid.Columns.DisplayIndex = 1
0
1053
by: Brian | last post by:
When my dgv was bound the displayindex setting worked fine. Now I am populating the dgv via in-line SQL and the setting the displayIndex does not work correctly. Before I attempt to set the displayIndex I set a bunch of columns to visible=False and that is working correctly. The data is all over the place, and not even close to the displayIndex I set using : With dgv .Columns("ColA").DisplayIndex = 0
0
8818
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9307
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9223
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6790
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6067
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4588
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4860
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3296
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2203
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.