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.