Results 1 to 8 of 8

Thread: [RESOLVED][2008]Listview subitem search Q

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2008
    Posts
    74

    Resolved [RESOLVED][2008]Listview subitem search Q

    this is what I was able to find so far, but its still not working. im shure im on the right track tho. Im trying to search subitems for text & if found remove the whole row, exept the last bold one ->item2 item12

    So I have 2 columns: the problem is that the code works after item 12, until item13 is reached, then i get error InvalidArgument=Value of '1' is not valid for 'index'. Parameter name: index

    Code:
    Column1     Column2
    item1         item11
    item2         item12
    item3
    thats my code.
    Code:
            For Each ListViewItem In ListView1.Items
                If ListViewItem.SubItems(1) Is Nothing Then
                    MessageBox.Show("nothing")
                    exit for
                Else
                    ListView1.Items.RemoveAt(0)
                End If
    EDIT: see post 6 & 7 for solution
    Last edited by goldenix; Apr 19th, 2008 at 10:58 AM.

    M.V.B. 2008 Express Edition

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width