473,386 Members | 1,883 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Problem while adding text to the last column in listview.

Hi all,
I have a listview control which has four columns like { Col1, Col2,
Col3, Col4}.

I add data in listview like this,

dim lvitem as listviewItem

lvItem = listvie1.Items.add("Text")
lvItem.SubItems.add("SubH1")
lvItem.SubItems.add("SubH2")
lvItem.SubItems.add(" ")

Now after getting execution of few functions I update the last entry in
my listview control
so for that I use.

for cnt = 0 to listview1.Items.count - 1
listview1.Items(cnt).SubItems(3).Text = "SubH3" /// Giving exact
problem
Next

The 2nd line is causing me runtime exception the description is,

Run-time exception thrown : System.ArgumentOutOfRangeException -
Specified argument was out of the range of valid values.
Parameter name: '3' is not a valid value for 'index'.

Initially it worked fine when I run my application 2-3 times but now it
is crashing continuously.
I have tried with the same functionality in the other application but
that application is
working fine.

I am not able to figure out what is the exact reason behind this
failure.

I there any known bug with the listview about this issue I have also
deleted the previous listview and added a new one but nothing is
working fine for me.

What could be the reason .

Thanks in advance.

Feb 2 '06 #1
0 1187

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

Similar topics

1
by: Angelina | last post by:
Hi, I wanted to add a few items to my listview control. The values of these will be obtained from other controls on my interface. When the user clicks the select button, they will need to be...
9
by: Eva | last post by:
Hi, I wanted to know how i can enter values into a specific column of a listview. I have tried the following code but this seems to enter all my values into the first column!!! Can anyone...
0
by: Andrew | last post by:
If item is a ListViewItem and str is a string, why do the following two lines not have the same effect ? item.SubItems.Add(new ListViewItem.ListViewSubItem()).Text = str;...
4
by: sonu | last post by:
Hi, I have a problem regarding use of a ListviewSorter class which is used to sort the items in the listview. Basically I have a listview with three columns as "Name","Size" and...
0
by: sonali_reddy123 | last post by:
Hi all, I have a listview control which has four columns like { Col1, Col2, Col3, Col4}. I add data in listview like this, dim lvitem as listviewItem
2
by: Paul W | last post by:
Hello, My problem concerns the shell. If there's a better forum for this post, please let me know. I'm trying to create a ListView control that displays the contents of a folder with all the...
0
by: Johnny J. | last post by:
I posted this last week, but didn't get any reply. I'm trying again now, because I'm getting desperate - I've tried everything I can think of myself. PLEASE help somebody. I've made an inherited...
2
by: =?iso-8859-1?B?S2VyZW0gR/xtcvxrY/w=?= | last post by:
Hi, i know how to work with the owner draw mode in the ListView-Class, but how do i draw the last three dots in a column if the text exceeds the columns width? To make it clear, i am talking...
7
by: =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post by:
I'm adding subheadings to a gridview. Each sub head has a few link buttons. I'm adding the controls in the rowdatabound event code follows: sorry about the length here. I have to be missing...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.