Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

 

I have a listview in my form with 3 collums (Nr - Name - Type) and an unknown number of row. When i select a row, i want to read the value of the Nr collum.

To make a long story short: I have figured our how to add items in the listview, but i don't know how to read them :(

 

It's my first year programming at high-school so my knowlege isn't that big...

 

Thnx in advance

Freak

Posted

Well i already tried that. But the problem is that you need to define the itemIndex to a indexnumer. But when you select another row the value of the indexnumbers dousn't change. So you keep on reading the same line. And that's not the point :)

 

Or am i missing something here?

Posted

   Private Sub lstApp_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstApp.SelectedIndexChanged
       txtAppNr.Text = lstApp.SelectedItems.Item(0).Text
   End Sub

this should be the code then?

Well it works if you only select 1 and you do not select another again.

If you do, this error appears:

An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in system.windows.forms.dll

 

Additional information: Specified argument was out of the range of valid values.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...