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

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:

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
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?


Nov 21 '05 #1
0 1145

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

Similar topics

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.
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;
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
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
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...
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.
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...
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
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
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,...
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,...
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...
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...
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();...
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...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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
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.