NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io


Stack Overflow

About
Products
For Teams

Join Stack Overflow to learn, share knowledge, and build your career.

Home
Public

Questions
Tags
Users
Find a Job
Jobs
Companies

Teams
Stack Overflow for Teams – Collaborate and share knowledge with a private group.

invalidargument=value of '11' is not valid for 'index'
Asked 7 years, 1 month ago
Active 7 years, 1 month ago
Viewed 769 times
0

I actually don't know what's wrong, I'm trieng to make a ListView and get a subitem's text of it.

the error occurred here:

Dim l As String = ListView2.Items(i).SubItems.Item(11).Text

i = 0 cause it's in the For loop, and that item should be "A." and I want the twelfth column so I take nr 11, but it says "invalidargument=value of '11' is not valid for 'index'".

Note: Program is multithreaded by BackGroundworkers and

CheckForIllegalCrossThreadCalls = False

EDIT: READ THIS IF YOU CAME HERE WITH THE SAME ERROR:

Nevermind, it's cause it isn't there, first it stores the 12th column into a string so it can be added later, but what I did is I added the code, it should get the text but it wasn't there it was still in a string

So, Make sure something is there

Thanks anyway
vb.net
listview
Share
Improve this question
Follow
edited Apr 15 '14 at 20:33
asked Apr 15 '14 at 20:19
user3384738
3355 bronze badges

and yes I've been searching this forum for the answer.. – user3384738 Apr 15 '14 at 20:23
Is only "11" not working, or every value doesnt? – Arman Apr 15 '14 at 20:28
Have you verified there are there 12 items in the collection? – Brandon Apr 15 '14 at 20:30

Add a comment
1 Answer
0

In ListViews the first column displayed is the main item. The second column that you see is the first subitem. So if you see 12 columns in total, you will have only 11 subitems and the last valid subitem index will be 10.
Share
Improve this answer
Follow
answered Apr 15 '14 at 20:32
Olivier Jacot-Descombes
86.2k1010 gold badges118118 silver badges160160 bronze badges

I know, I edited the post, I found the solution myself, thanks anyway! – user3384738 Apr 15 '14 at 20:33

Add a comment
Your Answer

Sign up or log in
Post as a guest
Name
Email

Required, but never shown

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy
Not the answer you're looking for? Browse other questions tagged vb.net listview or ask your own question.

The Overflow Blog

Using Kubernetes to rethink your system architecture and ease technical debt

Level Up: Linear Regression in Python – Part 1
Featured on Meta
Testing three-vote close and reopen on 13 network sites
The future of Community Promotion, Open Source, and Hot Network Questions Ads
Outdated Accepted Answers: flagging exercise has begun

Related
0
android: having two listviews in two listactivities didn't work
0
InvalidArgument=Value of '2' is not valid for 'index'
169
How to scroll to top of long ScrollView layout?
0
InvalidArgument=Value of '6' is not valid for index. Parameter name: index
0
InvalidArgument=Value of '4' is not valid for 'index'
1
InvalidArgument=Value of '5' is not valid for 'index'.
0
Solution for this error “InvalidArgument=Value of '0' is not valid for 'index'.”
1
ListView cannot be updated (or accessed) from a module in visual basic 2015
1
InvalidArgument=Value of ' ' is not valid for 'index' (' ' inside number)
Hot Network Questions

Getting all data of my JSON object from Serial.read() at once
Getting search results for Bourne shell
Could a ghost Parselmouth open the Chamber of Secrets?
Simulating a non-simple exponential distribution
Making a 10 digit number divisible by 3
Using tensor products in the bra-ket notation
What is the name of the publishing software used at IBM in the late 80s?
Precise skills connected with rating value
Approximation of a probability distribution
Herding Maids to stop being creepy
Executing reentrancy on Truffle Console: attacker not stealing 5 ether , why only 2 reentrant calls?

more hot questions
Question feed

Stack Overflow

Questions
Jobs
Developer Jobs Directory
Salary Calculator
Help
Mobile
Disable Responsiveness

Products

Teams
Talent
Advertising
Enterprise

Company

About
Press
Work Here
Legal
Privacy Policy
Terms of Service
Contact Us
Cookie Settings
Cookie Policy

Stack Exchange
Network

Technology
Life / Arts
Culture / Recreation
Science
Other

Blog
Facebook
Twitter
LinkedIn
Instagram

site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.5.20.39353
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.