Selected Row ListView

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • samoore33

    #1

    Selected Row ListView

    I have gotten my ListView populated, almost broke my arm patting myself
    on the back. Now I am not able to find out how to return information
    from a row that has been selected. I have searched and searched, this
    link seems to have somethings that should help me:

    But when I try using ListView1.Selec tedItems(0).Ite m(0).Text, I get an
    error of Specified argument was out of the range of valid values.

    I have the properties of the ListView set:
    lsvTest.CheckBo xes = True
    lsvTest.FullRow Select = True
    lsvTest.GridLin es = True

    Any help would be appreciated, thankfully I am already bald so that I
    am not pulling my hair out over this.

    Scott Moore

  • gene kelley

    #2
    Re: Selected Row ListView

    On 8 Sep 2006 09:34:45 -0700, "samoore33" <samoore33@gmai l.comwrote:
    >I have gotten my ListView populated, almost broke my arm patting myself
    >on the back. Now I am not able to find out how to return information
    >from a row that has been selected. I have searched and searched, this
    >link seems to have somethings that should help me:
    >http://www.experts-exchange.com/Prog..._21891615.html
    >But when I try using ListView1.Selec tedItems(0).Ite m(0).Text, I get an
    >error of Specified argument was out of the range of valid values.
    >
    >I have the properties of the ListView set:
    >lsvTest.CheckB oxes = True
    >lsvTest.FullRo wSelect = True
    >lsvTest.GridLi nes = True
    >
    >Any help would be appreciated, thankfully I am already bald so that I
    >am not pulling my hair out over this.
    >
    >Scott Moore
    A populated ListView Row consists of n number of Item.SubItems:

    Private Sub Listview1_ItemS electionChanged (ByVal sender As Object, ByVal e As _
    System.Windows. Forms.ListViewI temSelectionCha ngedEventArgs) Handles Listview1.ItemS electionChanged

    Dim MyFirstItem As String = e.Item.SubItems (0).Text
    Dim MyNextItem As String = e.Item.SubItems (1).Text

    End Sub

    Gene

    Comment

    Working...