Daniel - the bet is two pints at MEDC ;-)
I've gotta believe he at least clicked an item in the ListView before
he got the exception while testing, which means there is at least
one selected index and he's 'off-by-one' on his subitems index.
Robert - tt is always a good idea to do this:
if ( lvwTasks.SelectedIndices.Count > 0 )
{
ListViewItem lvi = lvwTasks.Items[lvwTasks.SelectedIndices[0]];
//
}
before inspecting the SelectedIndices collection.
Ok Robert - there's a lot riding on your code man - what was your issue?
--
Darren Shaffer
.NET Compact Framework MVP
Principal Architect
Connected Innovation
www.connectedinnovation.com
I bet the arg out of range exception is right here:
How much? :-D
I bet it is here:
index = lsvList.SelectedIndices(0)
Cheers
Daniel
--
http://www.danielmoth.com/Blog/
message I bet the arg out of range exception is right here:
updQt.Value = lsvList.Items(index).SubItems(1).Text
There is probably no SubItems(1) and you should be using
SubItems(0).Text
--
Darren Shaffer
.NET Compact Framework MVP
Principal Architect
Connected Innovation
www.connectedinnovation.com
Could you be more specific?
I tried follwing code and it got an exception saying something like
System.argumentsOutRange
Private Sub lsvList_SelectedIndexChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles lsvList.SelectedIndexChanged
Dim index As Integer
index = lsvList.SelectedIndices(0)
txtFMPNumber.Text = lsvList.Items(index).Text
updQt.Value = lsvList.Items(index).SubItems(1).Text
End Sub
Any ideas?
message you iterate the items and inspect their Checked state if using
checkboxes
or inspect the SelectedIndices array if not.
--
Darren Shaffer
.NET Compact Framework MVP
Principal Architect
Connected Innovation
www.connectedinnovation.com
I can add items to the ListView but could find a way to know which
row (in detail view) that the user taps.
The .NETCF does not pass current clicked index in the event
procedures any more. So how do you know which row user taps?
Thanks in advance!