Listview

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chuckzter
    New Member
    • Oct 2007
    • 56

    Listview

    Greetings,

    I would like to know how to get values from a listview with it having 5 columns. And How to insert values unto it. It's so much different than listbox. I've been doing a lot of searching but alas, no luck on finding what i am looking for. Thanks in advance.
  • lotus18
    Contributor
    • Nov 2007
    • 865

    #2
    Originally posted by chuckzter
    Greetings,

    I would like to know how to get values from a listview with it having 5 columns. And How to insert values unto it. It's so much different than listbox. I've been doing a lot of searching but alas, no luck on finding what i am looking for. Thanks in advance.
    For getting values, you can try the SelectedItem. For inserting, ListItems.Add method will do. BTW, What version of vb are you using?

    Rey Sean

    Comment

    • CyberSoftHari
      Recognized Expert Contributor
      • Sep 2007
      • 488

      #3
      This link will give all about Listview
      ListView Control for Visual Basic 6.0 Users

      Comment

      • chuckzter
        New Member
        • Oct 2007
        • 56

        #4
        I'm using visual basic 6.0.


        Can anybody give me a brief explanation on how to manipulate or use the listview effectively?

        @Poster above me:
        I've seen that page before, still i can't get what i want to achieve. Help please.

        Comment

        • lotus18
          Contributor
          • Nov 2007
          • 865

          #5
          Originally posted by chuckzter
          I'm using visual basic 6.0.


          Can anybody give me a brief explanation on how to manipulate or use the listview effectively?

          @Poster above me:
          I've seen that page before, still i can't get what i want to achieve. Help please.
          Are you using a database? I can give you a sample code in populating items on a listview

          [CODE=vb]SetConnection 'My Main Connection

          rs.Open "Select * From <TableName>", con, 3, 3
          Listview1.ListI tems.Clear
          While Not rs.EOF
          On Error Resume Next 'Ignores null items
          With Listview1.ListI tems.Add(, , rs!<PrimaryKey> , 1, 1)
          .SubItems(1) = rs!<Field1>
          .SubItems(2) = rs!<Field2>
          .SubItems(3) = rs!<Field3>
          .SubItems(4) = rs!<Field4>
          End With
          rs.MoveNext
          Wend[/CODE]

          Rey Sean

          Comment

          • debasisdas
            Recognized Expert Expert
            • Dec 2006
            • 8119

            #6
            Please find some related articles here and here.

            Comment

            Working...